﻿using System;
using System.Data;
using System.Configuration;
using System.Text.RegularExpressions;
using System.Text;
using System.IO;
using nspLable.Manage;
using nspLable.Function.Systems;
using Base.Core;
using System.Data.SqlClient;
using Base;
using SqlOperate;
using nspJob;
/// <summary>
/// 
/// Tempinc 的摘要说明
/// </summary>
namespace nspLable.Function.Systems
{
    public class Tempinc : Base.BasePage
    {
        Regex[] regex = new Regex[5];
        private static string Model;
        private static string breakstr = "\r\n";

        public Tempinc(string StrModule)
        {
            this._StrModule = StrModule;
            Model = StrModule;
            RegexOptions options;
            options = RegexOptions.Singleline | RegexOptions.IgnoreCase;
            regex[0] = new Regex(@"{[WS][SY]_\w+}", options);
            regex[1] = new Regex(@"{PB_\w+([\(]+(\b[,0-9]+\b)?[\)]+)?}", options);
            regex[2] = new Regex(@"{PR_\w+}", options);
            regex[3] = new Regex(@"../../../", options);
        }
        private string _StrModule;//Purchase_Trade Supply_Trade......
        public string StrModule
        {
            get { return this._StrModule; }
        }


        /// <summary>
        /// 获取模板
        /// </summary>
        /// <param name="pathName">模板路径</param>
        /// <returns></returns>
        public string GetTemplate(string pathName)
        {
            StringBuilder builder = new StringBuilder();
            string str = "";
            using (StreamReader reader = new StreamReader(pathName, Encoding.Default))
            {
                StringBuilder builder2 = new StringBuilder();
                builder2.Append(reader.ReadToEnd());
                reader.Close();
                str = Hope_HtmlResult(builder2.ToString());
            }

            return str;
        }


        /// <summary>
        /// 外部调用函数
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public string Hope_HtmlResult(string str)
        {
            string resultHtml = "";
            resultHtml = Hope_htmlAll(str);
            resultHtml = Hope_htmlAll(resultHtml);  //使用三层，考虑资源问题
            return resultHtml;
        }


        /// <summary>
        /// 标签处理方法
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        private string Hope_htmlAll(string str)
        {
            string Restr = "";
            Restr = str;
            string strInfo_PB = "";
            string strInfo_PR = "";
            string strInfo_SY = "";
            string[] arrInfo;
            try
            {
                Restr = Restr.Replace("../../../", "{PB_WebUrl}");


                //处理私有标签
                foreach (Match match in regex[2].Matches(Restr))
                {
                    strInfo_PR = strInfo_PR + match.Groups[0].ToString() + "|";
                }
                if (strInfo_PR != "")
                    Restr = PRFunction(Restr, strInfo_PR);


                foreach (Match match in regex[0].Matches(Restr))
                {
                    strInfo_SY = strInfo_SY + match.Groups[0].ToString() + "|";
                }
                arrInfo = strInfo_SY.Split('|');
                for (int i = 0; i < arrInfo.Length - 1; i++)
                {
                    Restr = Restr.Replace(arrInfo[i], eval(staticTitle(arrInfo[i].ToString())));
                }


                //处理公共标签
                foreach (Match match in regex[1].Matches(Restr))
                    strInfo_PB = strInfo_PB + match.Value.ToString() + "|";
                if (strInfo_PB != "")
                    Restr = PBFunction(Restr, strInfo_PB);

            }
            catch (Exception e)
            {
                throw e;
            }

            return Restr;
        }


        /// <summary>
        /// 替换函数标签
        /// </summary>
        /// <param name="funTitle"></param>
        /// <param name="arry"></param>
        /// <returns></returns>
        private string eval(string str)
        {

            string Restr = "";
            TSystemLable Temp = new TSystemLable();
            try
            {
                switch (str.Substring(0, 3).ToUpper())
                {
                    case "WS_":   //处理用户自定义标签
                        Restr = WSFunction(str);
                        break;
                    case "SY_":   //处理系统标签
                        Temp = Get_Function(str);
                        if (Temp.ID == 0) throw new Exception("{" + str + "}");
                        Restr = SYFunction(Temp);
                        break;
                }
            }
            catch (Exception e)
            {
                Restr = e.Message.ToString();
            }
            return Restr;
        }


        /// <summary>
        /// 处理全局变量
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public string PBFunction(string strInfo, string str)
        {
            string[] strArray;
            strArray = str.Split('|');
            DataTable WebTable = Function.GetDataTable("select * from W_WebBasic");
            DataTable dt = GetMetaKeyWords(StrModule);

            for (int i = 0; i < strArray.Length - 1; i++)
            {
                try
                {
                    switch (staticTitle(strArray[i].ToString()).ToUpper())
                    {
                        case "PB_WEBURL":
                            strInfo = strInfo.Replace(strArray[i].ToString(), BasePage.Config.WebURL);
                            break;
                        case "PB_TAOBAOURL":
                            strInfo = strInfo.Replace(strArray[i].ToString(), TaoSiteUrl);
                            break;
                        case "PB_NEWSURL":
                            strInfo = strInfo.Replace(strArray[i].ToString(), NewsSiteUrl);
                            break;
                        case "PB_WEBNAME":
                            strInfo = strInfo.Replace(strArray[i].ToString(), WebTable.Rows[0]["WebName"].ToString());//WebTable.Rows[0]["WebName"].ToString()
                            break;
                        case "PB_ATAREA":          //地区列表
                            strInfo = strInfo.Replace(strArray[i].ToString(), systemic.SY_AtArea(StrModule));
                            break;
                        case "PB_WEBTEL":
                            strInfo = strInfo.Replace(strArray[i].ToString(), WebTable.Rows[0]["HotTel"].ToString());
                            break;
                        case "PB_WEBLOGO":
                            string str1 = "<img src=\"";
                            str1 += Function.ProcessImageUrl(WebTable.Rows[0]["WebLOGO"].ToString());
                            str1 += "\">";
                            strInfo = strInfo.Replace(strArray[i].ToString(), str1);
                            break;
                        case "PB_KEYWORD":
                            string ss = "";
                            if (StrModule.Contains("_"))
                            {
                                ss = StrModule.Substring(0, StrModule.IndexOf("_"));
                            }
                            else
                            {
                                ss = "Supply";
                            }
                            StringBuilder strBuilder = new StringBuilder();
                            strBuilder.Append("<span id='search_result'>&nbsp;&nbsp;正在更新....</span>");
                            strBuilder.Append("<script type='text/javascript'> AjaxSearch('search_result','" + ss + "')</script>");
                            strInfo = strInfo.Replace(strArray[i].ToString(), strBuilder.ToString());
                            break;
                        case "PB_SEARCHINFO":
                            strInfo = strInfo.Replace(strArray[i].ToString(), "<script type=\"text/javascript\" src=\"{PB_WebURL}js/Search.js\" ></script>");
                            break;
                        case "PB_METAKEYWORDS":
                            if (dt.Rows.Count > 0)
                                strInfo = strInfo.Replace(strArray[i].ToString(), dt.Rows[0]["Keywords"].ToString());
                            break;
                        case "PB_METADESCRIPTION":
                            if (dt.Rows.Count > 0)
                                strInfo = strInfo.Replace(strArray[i].ToString(), dt.Rows[0]["Descriptions"].ToString());
                            break;
                        case "PB_TITLE":
                            if (dt.Rows.Count > 0)
                                strInfo = strInfo.Replace(strArray[i].ToString(), dt.Rows[0]["Title"].ToString());
                            break;
                        case "PB_SYSTEMTEL"://普通电话
                            strInfo = strInfo.Replace(strArray[i].ToString(), WebTable.Rows[0]["SystemTel"].ToString());
                            break;
                        case "PB_HOTTEL":   //热线电话
                            strInfo = strInfo.Replace(strArray[i].ToString(), WebTable.Rows[0]["HotTel"].ToString());
                            break;
                        case "PB_VIPGRADE":   //显示等级
                            string Sort = tempInfo(strArray[i].ToString());
                            string Name = GetSortName(Sort);
                            strInfo = strInfo.Replace(strArray[i].ToString(), Name);
                            break;
                        case "PB_POSTFIX":   //伪静态后缀
                            strInfo = strInfo.Replace(strArray[i].ToString(), BasePage.Config.Rewrite);
                            break;
                        case "PB_SEARCHJOB":   //人才搜索
                            string strdir = Base.XMLProcess.Read("xml/Label.config", "configuration/label[@type='Search_Job']", "path");
                            string Path = AppDomain.CurrentDomain.BaseDirectory.ToString() + "xml/" + strdir;
                            string Content = Function.GetFile(Path);
                            strInfo = strInfo.Replace(strArray[i].ToString(), Content);
                            break;
                        case "PB_JOBLOGIN":   //人才登录
                            string strdirs = Base.XMLProcess.Read("xml/Label.config", "configuration/label[@type='Job_Login']", "path");
                            string Paths = AppDomain.CurrentDomain.BaseDirectory.ToString() + "xml/" + strdirs;
                            string Contents = Function.GetFile(Paths);
                            strInfo = strInfo.Replace(strArray[i].ToString(), Contents);
                            break;
                        case "PB_ZSHD":   //浙商活动（首页）
                            string zshdInfo = "";
                            zshdInfo = SAS.Toolkit.SASAPIHelper.GetActivityList(6, 0);
                            strInfo = strInfo.Replace(strArray[i].ToString(), zshdInfo);
                            strInfo = strInfo.Replace("·", "▪&nbsp;");
                            break;
                        case "PB_TZGHD":   //淘之购活动（首页）
                            string tzghdInfo = "";
                            tzghdInfo = SAS.Toolkit.SASAPIHelper.GetActivityList(6, 1);
                            strInfo = strInfo.Replace(strArray[i].ToString(), tzghdInfo);
                            strInfo = strInfo.Replace("·", "▪&nbsp;");
                            break;
                        case "PB_ZSNEWS":   //浙商新闻资讯
                            string zsnewsstr = "<div class=\"ozx1 mar_top3\">" + breakstr;
                            string zsnewsstr1 = "";
                            string zsnewsstr2 = "";
                            string zsnewsstr3 = "";
                            int newscount = 0;

                            foreach (SAS.Toolkit.NewsInfo ninfo in SAS.Toolkit.SASAPIHelper.GetNewsInfoList())
                            {
                                if (newscount == 0)
                                {
                                    zsnewsstr1 += "<p class=\"ozx1lt\">" + breakstr;
                                    zsnewsstr1 += "<a title=\"" + ninfo.NewsTitle + "\" target=\"_blank\" href=\"" + ninfo.NewsUrl + "\"><img alt=\"\" src=\"" + ninfo.NewsPic + "\" /></a>" + breakstr;
                                    zsnewsstr1 += "<span class=\"zi\"><a title=\"" + ninfo.NewsTitle + "\" target=\"_blank\" href=\"" + ninfo.NewsUrl + "\">" + ninfo.NewsTitle + "</a></span>" + breakstr;
                                    zsnewsstr1 += "</p>" + breakstr;
                                }
                                else if (newscount < 5)
                                {
                                    zsnewsstr2 += "<li>▪&nbsp;<a title=\"" + ninfo.NewsTitle + "\" target=\"_blank\" href=\"" + ninfo.NewsUrl + "\">" + ninfo.NewsTitle + "</a></li>" + breakstr;
                                }
                                else
                                {
                                    zsnewsstr3 += "<li>▪&nbsp;<a title=\"" + ninfo.NewsTitle + "\" target=\"_blank\" href=\"" + ninfo.NewsUrl + "\">" + ninfo.NewsTitle + "</a></li>" + breakstr;
                                }

                                newscount++;
                            }

                            zsnewsstr += zsnewsstr1 + breakstr + "<ul class=\"ozx1rt\">" + zsnewsstr2 + "</ul>" + breakstr + "</div><ul class=\"ozx2rt mar_top3\">" + zsnewsstr3 + "</ul>" + breakstr;
                            strInfo = strInfo.Replace(strArray[i].ToString(), zsnewsstr);
                            break;
                        case "PB_NEWSKEYWORD":  //浙商新闻搜索关键字
                            string newskeywords = "<table width=\"100%;\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"ozxtb\">";
                            SqlParameter[] param = new SqlParameter[] 
                            {
                                new SqlParameter("@strSelect", "TOP 9 Name"), 
                                new SqlParameter("@strwhere", ""),
                                new SqlParameter("@strtableName", "W_Keyword"), 
                                new SqlParameter("@strOrder", "order by EditDate desc") 
                            };
                            DataTable strtable = SqlOperate.SqlHelper.ExecuteTable(CommandType.StoredProcedure, "SP_SelectByWhere", param);
                            int keywordcounts = 0;
                            foreach (DataRow dr in strtable.Rows)
                            {
                                if (keywordcounts % 3 == 0)
                                {
                                    newskeywords += "<tr>" + breakstr;
                                }

                                newskeywords += "<td><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"" + NewsSiteUrl + "Search.aspx?type=news&tags=" + System.Web.HttpUtility.UrlEncode(dr["Name"].ToString()) + "\">" + dr["Name"] + "</a></td>";

                                if (keywordcounts % 3 == 2 || keywordcounts == strtable.Rows.Count)
                                {
                                    newskeywords += "</tr>" + breakstr;
                                }
                                keywordcounts++;
                            }
                            newskeywords += "</table>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), newskeywords);
                            break;
                        case "PB_TAOGOUGOODS":  //淘之购推荐商品
                            string taogoods1 = "<ul class=\"ozx4 mar_top3\">" + breakstr;
                            string taogoods2 = "<ul class=\"ozx2rt mar_top\">" + breakstr;
                            int goods1count = 0;
                            SAS.Toolkit.TaoBaoGoodInfo[] tbglist = SAS.Toolkit.SASAPIHelper.GetShangjiGoodInfoList();
                            if (tbglist != null && tbglist.Length > 0)
                            {
                                foreach (SAS.Toolkit.TaoBaoGoodInfo tbginfo in tbglist)
                                {
                                    string goodname = tbginfo.GName;
                                    string goodurl = TaoSiteUrl + "productshow-" + tbginfo.GNumiid + ".html";
                                    string goodpic = tbginfo.GPic + "_sum.jpg";
                                    if (tbginfo.Gid < 4)
                                    {
                                        taogoods1 += "<li class=\"ozx4li\">" + breakstr;
                                        taogoods1 += "<a title=\"" + goodname + "\" target=\"_blank\" href=\"" + goodurl + "\"><img alt=\"" + goodname + "\" src=\"" + goodpic + "\" /></a>" + breakstr;
                                        taogoods1 += "<span class=\"zi\"><a title=\"" + goodname + "\" target=\"_blank\" href=\"" + goodurl + "\">" + Common.GetString(goodname, 0, 15) + "</a></span>" + breakstr;
                                        taogoods1 += "</li>" + breakstr;
                                        if (goods1count < 2) taogoods1 += "<li class=\"ozx4li2\"></li>" + breakstr;
                                        goods1count++;
                                    }
                                    else
                                    {
                                        taogoods2 += "<li>" + breakstr;
                                        taogoods2 += "<a title=\"" + tbginfo.CName + "\" target=\"_blank\" class=\"l_c00\" href=\"" + TaoSiteUrl + "goodslist-p-" + tbginfo.Cid + ".html\">[" + Common.GetString(tbginfo.CName, 0, 6) + "]</a> " + breakstr;
                                        taogoods2 += "<a title=\"" + goodname + "\" target=\"_blank\" href=\"" + goodurl + "\">" + goodname + "</a>" + breakstr;
                                        taogoods2 += "</li>" + breakstr;
                                    }
                                }
                            }
                            taogoods1 += "</ul>" + breakstr;
                            taogoods2 += "</ul>" + breakstr;
                            strInfo = strInfo.Replace(strArray[i].ToString(), taogoods1 + taogoods2);
                            break;
                        case "PB_QGINFO":   //求购信息（首页 轮滚 前6条）
                            string spInfo = "";
                            DataTable spTab = GetZDGQInfo(6, "C_Purchase ", 1);
                            spInfo += "<ul class=\"zi1\">";
                            foreach (DataRow dr in spTab.Rows)
                            {
                                spInfo += "<li><span class=\"nr1\"><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Purchase/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></span><span class=\"nr2\">" + GetAreaUrl("{PB_WebURL}Purchase/trade.aspx", dr["province"].ToString(), dr["city"].ToString(), dr["area"].ToString()) + "</span></li>";
                            }
                            spInfo += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), spInfo);
                            break;
                        case "PB_GYINFO":   //供应信息（首页 轮滚 前6条）
                            string gyInfo = "";
                            DataTable gyTab = GetZDGQInfo(6, "C_Supply", 1);
                            gyInfo += "<ul class=\"zi1\">";
                            foreach (DataRow dr in gyTab.Rows)
                            {
                                gyInfo += "<li><span class=\"nr1\"><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Supply/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></span><span class=\"nr2\">" + GetAreaUrl("{PB_WebURL}Supply/trade.aspx", dr["province"].ToString(), dr["city"].ToString(), dr["area"].ToString()) + "</span></li>";
                            }
                            gyInfo += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), gyInfo);
                            break;

                        case "PB_QGINFO2":   //求购信息（首页 7-13条）
                            string spInfo2 = "";
                            DataTable spTab2 = GetZDGQInfo(6, "C_Purchase ", 0);
                            spInfo2 += "<ul class=\"ohgytc\">";
                            foreach (DataRow dr in spTab2.Rows)
                            {

                                spInfo2 += "<li>" + GetAreaUrl("{PB_WebURL}Purchase/trade.aspx", dr["province"].ToString(), dr["city"].ToString(), dr["area"].ToString()) + " <a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Purchase/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\"> " + dr["Name"] + "</a></li>";
                            }
                            spInfo2 += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), spInfo2);
                            break;
                        case "PB_GYINFO2":   //供应信息（首页 7-13条）
                            string gyInfo2 = "";
                            DataTable gyTab2 = GetZDGQInfo(6, "C_Supply ", 0);
                            gyInfo2 += "<ul class=\"ohgytc\">";
                            foreach (DataRow dr in gyTab2.Rows)
                            {
                                gyInfo2 += "<li>" + GetAreaUrl("{PB_WebURL}Supply/trade.aspx", dr["province"].ToString(), dr["city"].ToString(), dr["area"].ToString()) + " <a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Supply/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\"> " + dr["Name"] + "</a></li>";
                            }
                            gyInfo2 += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), gyInfo2);
                            break;
                        case "PB_EXPOINDEX"://首页的图片类型的行业展会
                            string exInfo = "";
                            DataTable exTab = GetEXproInfo(1);
                            foreach (DataRow dr in exTab.Rows)
                            {
                                string reallyTitel = dr["Title"].ToString();
                                if (reallyTitel.Length > 10)
                                {
                                    reallyTitel = reallyTitel.Substring(0, 10);
                                }
                                string ads = dr["Place"].ToString();
                                if (ads.Length > 10)
                                {
                                    ads = ads.Substring(0, 10);
                                }
                                exInfo += "<a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\"><img alt=\"" + dr["Title"] + "\" src=\"" + dr["Picture"].ToString() + "\" /></a>";
                                exInfo += "<p><a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + reallyTitel + "</a></p>";
                                exInfo += "<p>地点:" + ads + "</p>";
                                exInfo += "<p>时间:" + Common.DateTransform(dr["StartDate"].ToString(), 1) + "</p>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), exInfo);
                            break;
                        case "PB_INDEXTOPAD": //首页顶端的广告
                            string indextopad = "";
                            DataTable indextopadTab = GetAD(1, 17);
                            foreach (DataRow dr in indextopadTab.Rows)
                            {
                                indextopad += "<p class=\"inxad mar_top\"><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a></p>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), indextopad);
                            break;
                        case "PB_JOBINFO": //首页招聘信息
                            string jobInfo = "";
                            DataTable jobTab = GetJob(9);
                            jobInfo += "<ul class=\"ozp mar_top\">";
                            foreach (DataRow dr in jobTab.Rows)
                            {
                                jobInfo += "<li>";
                                jobInfo += "<p class=\"zi1\">";
                                jobInfo += "<a title=\"\" target=\"_blank\" class=\"l_ff7e00\" href=\"{PB_WebURL}JobDetail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Position"].ToString() + "</a>";
                                jobInfo += "</p>";
                                jobInfo += "<p class=\"zi2\"><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}shop/job/" + dr["LoginName"] + Base.BasePage.Config.Rewrite + "\">" + dr["CompanyName"] + "</a></p>";
                                jobInfo += "</li>";
                            }
                            jobInfo += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), jobInfo);
                            break;
                        case "PB_企业招聘信息":
                            string jobInfo2 = "";
                            DataTable jobTab2 = GetJob(10);
                            foreach (DataRow dr in jobTab2.Rows)
                            {
                                jobInfo2 += "<li>";
                                jobInfo2 += "<p class=\"zi1\">";
                                jobInfo2 += "<a title=\"" + dr["TypeName"] + "\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebURL}Job/JobTrade-" + dr["TypeID"] + Base.BasePage.Config.Rewrite + "\">[" + Function.GetString(dr["TypeName"].ToString(), 7) + "]</a> <a title=\"\" target=\"_blank\" href=\"{PB_WebURL}JobShow-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(dr["Position"].ToString(), 35) + "</a>";
                                jobInfo2 += "</p>";
                                jobInfo2 += "<p class=\"zi3\">[" +Function.GetString(dr["Address"].ToString(),5) + "]</p>";
                                jobInfo2 += "<p class=\"zi2\">[" + dr["AddDate"].ToString().Split(' ')[0] + "]</p>";
                                jobInfo2 += "</li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), jobInfo2);
                            break;

                        case "PB_RESUMEINFO": //首页求职信息
                            string resumeInfo = "";
                            DataTable resumeTab = GetResume(9);
                            resumeInfo += "<ul class=\"ozp mar_top\">";
                            foreach (DataRow dr in resumeTab.Rows)
                            {
                                resumeInfo += "<li>";
                                resumeInfo += "<p class=\"zi1\">";
                                resumeInfo += "<a title=\"\" target=\"_blank\" class=\"l_ff7e00\" href=\"{PB_WebURL}job/ResumeShow-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Name"].ToString() + "</a>";
                                resumeInfo += "</p>";
                                resumeInfo += "<p class=\"zi2\"><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}job/ResumeShow-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["WantPosition"] + "</a></p>";
                                resumeInfo += "</li>";
                            }
                            resumeInfo += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), resumeInfo);
                            break;
                        case "PB_人才求职信息":
                            string resumeInfo2 = "";
                            DataTable resumeTab2 = GetResume(10);
                            foreach (DataRow dr in resumeTab2.Rows)
                            {
                                resumeInfo2 += "<li>";
                                resumeInfo2 += "<p class=\"zi1\">▪&nbsp;" + dr["Name"] + "(" + dr["Sex"] + ") <a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebURL}job/ResumeShow-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">[" + Function.GetString(dr["WantPosition"].ToString(), 15) + "]</a></p>";
                                resumeInfo2 += "<p class=\"zi3\">[" + Function.GetString(dr["WantAddress"].ToString(), 5) + "]</p>";
                                resumeInfo2 += "<p class=\"zi2\">" + dr["AddDate"].ToString().Split(' ')[0] + "</p>";
                                resumeInfo2 += "</li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), resumeInfo2);
                            break;
                        case "PB_DONEKNOW": //首页知道 （已解决）
                            string knowInfo = "";
                            DataTable knowTab = GetKnowInfo(0);
                            knowInfo += "<ul class=\"ozx2rt mar_top3\">";
                            foreach (DataRow dr in knowTab.Rows)
                            {
                                knowInfo += "<li>▪&nbsp;";
                                knowInfo += "<a title=\"" + dr["Caption"] + "\" target=\"_blank\" href=\"{PB_WebURL}Know/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Caption"] + "</a>";
                                knowInfo += "</li>";
                            }
                            knowInfo += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), knowInfo);
                            break;
                        case "PB_UNDONEKNOW": //首页知道 （未解决）
                            string unknowInfo = "";
                            DataTable unknowTab = GetKnowInfo(1);
                            unknowInfo += "<ul class=\"ozx2rt mar_top3\">";
                            foreach (DataRow dr in unknowTab.Rows)
                            {
                                unknowInfo += "<li>▪&nbsp;";
                                unknowInfo += "<a title=\"" + dr["Caption"] + "\" target=\"_blank\" href=\"{PB_WebURL}Know/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Caption"] + "</a>";
                                unknowInfo += "</li>";
                            }
                            unknowInfo += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), unknowInfo);
                            break;

                        case "PB_PAGESTYLE":
                            int pindex = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["Page"] != null)
                                pindex = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["Page"]);
                            if (pindex < 1) pindex = 1;
                            strInfo = strInfo.Replace(strArray[i].ToString(), pindex.ToString());
                            break;
                        case "PB_PAGESTR":
                            string pagestr = "";
                            int index = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["Page"] != null)
                                index = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["Page"]);
                            if (index < 1) index = 1;
                            int prevPage = index - 1;
                            int nextPage = index + 1;
                            pagestr = "<em class=\"lt\"><a title=\"\" href=\"Trade-p" + prevPage + Base.BasePage.Config.Rewrite + "\"></a></em><em class=\"rt\"><a title=\"\" href=\"Trade-p" + nextPage + Base.BasePage.Config.Rewrite + "\">下一页</a></em>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), pagestr);
                            break;
                        case "PB_LISTSUPPLY":
                            string listSupply = "";
                            DataTable listSupplyTab = GetZDGQInfo(10, "C_Supply", 1);
                            foreach (DataRow dr in listSupplyTab.Rows)
                            {
                                listSupply += "<li>▪&nbsp;<a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Supply/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), listSupply);
                            break;
                        case "PB_LISTPURCHASE":
                            string listPurchase = "";
                            DataTable listPurchaseTab = GetZDGQInfo(10, "C_Purchase", 1);
                            foreach (DataRow dr in listPurchaseTab.Rows)
                            {
                                listPurchase += "<li>▪&nbsp;<a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Purchase/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), listPurchase);
                            break;
                            break;
                        case "PB_SUPPLYLISTAD": //供应列表广告
                            string supplylistad = "";
                            DataTable supplylistadTab = GetAD(1, 18);
                            foreach (DataRow dr in supplylistadTab.Rows)
                            {
                                supplylistad += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), supplylistad);
                            break;
                        case "PB_PURCHASELISTAD": //求购列表广告
                            string purchaselistad = "";
                            DataTable purchaselistadTab = GetAD(1, 19);
                            foreach (DataRow dr in purchaselistadTab.Rows)
                            {
                                purchaselistad += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), purchaselistad);
                            break;
                        case "PB_EXPOLIST":
                            string exlist = "";
                            DataTable exlistTab = GetEXproList(6);
                            foreach (DataRow dr in exlistTab.Rows)
                            {
                                exlist += "<li><a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">[报名]</a> <a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"].ToString() + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), exlist);
                            break;
                        case "PB_EXPOLISTTEMP": //其他频道用展会预览信息
                            string exlisttemp = "";
                            DataTable exlistTabtemp = GetEXproList(9);
                            int extempcount = 0;
                            foreach (DataRow dr in exlistTabtemp.Rows)
                            {
                                if (extempcount == 1)
                                {
                                    exlisttemp += "<ul class=\"chuod cp3\">";
                                }

                                if (extempcount == 0)
                                {
                                    exlisttemp += "<div class=\"czhnr\">";
                                    exlisttemp += "<a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + dr["Picture"] + "\" /></a>";
                                    exlisttemp += "<b><a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"].ToString() + "</a></b>";
                                    exlisttemp += "<p>主办：" + dr["Authorize"].ToString() + " <a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">[报名]</a></p>";
                                    exlisttemp += "</div>";
                                    exlisttemp += "<p class=\"ohlne mar_top\"></p>";
                                }
                                else
                                {
                                    exlisttemp += "<li><a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">[报名]</a> <a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"].ToString() + "</a></li>";
                                }

                                extempcount++;
                            }

                            if (extempcount > 0) exlisttemp += "</ul>";
                            else exlisttemp += "<ul class=\"chuod cp3\"></ul>";

                            strInfo = strInfo.Replace(strArray[i].ToString(), exlisttemp);
                            break;
                        case "PB_EXPOIMGS":
                            string eximgs = "";
                            DataTable eximgsTab = GetEXproAdImg(20);
                            eximgs += "<div class=\"comc\" id=\"ctabc1\">";
                            foreach (DataRow dr in eximgsTab.Rows)
                            {
                                eximgs += "<div class=\"con\"><a title=\"" + dr["Ad_Leter"].ToString() + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img alt=\"" + dr["Ad_Leter"].ToString() + "\" src=\"{PB_WebURL}" + dr["Ad_ImageAdrees"] + "\" /></a></div>";
                            }
                            eximgs += "</div><ul class=\"comt\" id=\"ctabt1\">";
                            int k = 1;
                            foreach (DataRow dr in eximgsTab.Rows)
                            {
                                eximgs += "<li>" + k.ToString() + "</li>";
                                k++;
                            }
                            eximgs += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), eximgs);
                            break;
                        case "PB_INDUSTRYEXPO":
                            string industryExpoWhere = " 1=1 ";
                            string industryExpoType = "";
                            string industryExpoYear = "";
                            string industryExpoMonth = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["type"] != null && System.Web.HttpContext.Current.Request.QueryString["type"] != "")
                            {
                                industryExpoType = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["type"]);
                            }
                            if (System.Web.HttpContext.Current.Request.QueryString["year"] != null && System.Web.HttpContext.Current.Request.QueryString["year"] != "")
                            {
                                industryExpoYear = System.Web.HttpContext.Current.Request.QueryString["year"];
                            }
                            if (System.Web.HttpContext.Current.Request.QueryString["month"] != null && System.Web.HttpContext.Current.Request.QueryString["month"] != "")
                            {
                                industryExpoMonth = System.Web.HttpContext.Current.Request.QueryString["month"];
                            }
                            if (industryExpoType != "")
                            {
                                industryExpoWhere += " and type=" + industryExpoType;
                            }
                            if(industryExpoYear!="")
                            {
                                industryExpoWhere += " and (YEAR(a.StartDate) = " + industryExpoYear + ")  ";
                            }
                            if (industryExpoMonth != "")
                            {
                                industryExpoWhere += " and (Month(a.StartDate) = " + industryExpoMonth + ")  ";
                            }
                            string industryExpo = "";
                            DataTable inExpoTab = GetExpoList("工业区展会", industryExpoWhere);
                            foreach (DataRow dr in inExpoTab.Rows)
                            {
                                industryExpo += "<li>";
                                industryExpo += "<p class=\"zi1\"><a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" class=\"l_c00\" href=\"#\">[" + dr["Type"] + "]</a> <a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"].ToString() + "</a></p>";
                                industryExpo += "<p class=\"zi3\">[" + dr["Place"] + "]</p><p class=\"zi2\">" + dr["StartDate"] + "</p></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), industryExpo);
                            break;
                        case "PB_MATERIALEXPO":
                            string MaterialExpoWhere = " 1=1 ";
                            string MaterialExpoType = "";
                            string MaterialExpoYear = "";
                            string MaterialExpoMonth = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["type"] != null && System.Web.HttpContext.Current.Request.QueryString["type"] != "")
                            {
                                MaterialExpoType = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["type"]);
                            }
                            if (System.Web.HttpContext.Current.Request.QueryString["year"] != null && System.Web.HttpContext.Current.Request.QueryString["year"] != "")
                            {
                                MaterialExpoYear = System.Web.HttpContext.Current.Request.QueryString["year"];
                            }
                            if (System.Web.HttpContext.Current.Request.QueryString["month"] != null && System.Web.HttpContext.Current.Request.QueryString["month"] != "")
                            {
                                MaterialExpoMonth = System.Web.HttpContext.Current.Request.QueryString["month"];
                            }
                            if (MaterialExpoType != "")
                            {
                                MaterialExpoWhere += " and type=" + MaterialExpoType;
                            }
                            if (MaterialExpoYear != "")
                            {
                                MaterialExpoWhere += " and (YEAR(a.StartDate) = " + MaterialExpoYear + ")  ";
                            }
                            if (MaterialExpoMonth != "")
                            {
                                MaterialExpoWhere += " and (Month(a.StartDate) = " + MaterialExpoMonth + ")  ";
                            }

                            string MaterialExpo = "";
                            DataTable MaterialExpoTab = GetExpoList("原材料展会", MaterialExpoWhere);
                            foreach (DataRow dr in MaterialExpoTab.Rows)
                            {
                                MaterialExpo += "<li>";
                                MaterialExpo += "<p class=\"zi1\"><a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" class=\"l_c00\" href=\"#\">[" + dr["Type"] + "]</a> <a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"].ToString() + "</a></p>";
                                MaterialExpo += "<p class=\"zi3\">[" + dr["Place"] + "]</p><p class=\"zi2\">" + dr["StartDate"] + "</p></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), MaterialExpo);
                            break;
                        case "PB_CONSUMEREXPO":
                            string ConsumerExpoWhere = " 1=1 ";
                            string ConsumerExpoType = "";
                            string ConsumerExpoYear = "";
                            string ConsumerExpoMonth = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["type"] != null && System.Web.HttpContext.Current.Request.QueryString["type"] != "")
                            {
                                ConsumerExpoType = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["type"]);
                            }
                            if (System.Web.HttpContext.Current.Request.QueryString["year"] != null && System.Web.HttpContext.Current.Request.QueryString["year"] != "")
                            {
                                ConsumerExpoYear = System.Web.HttpContext.Current.Request.QueryString["year"];
                            }
                            if (System.Web.HttpContext.Current.Request.QueryString["month"] != null && System.Web.HttpContext.Current.Request.QueryString["month"] != "")
                            {
                                ConsumerExpoMonth = System.Web.HttpContext.Current.Request.QueryString["month"];
                            }
                            if (ConsumerExpoType != "")
                            {
                                ConsumerExpoWhere += " and type=" + ConsumerExpoType;
                            }
                            if (ConsumerExpoYear != "")
                            {
                                ConsumerExpoWhere += " and (YEAR(a.StartDate) = " + ConsumerExpoYear + ")  ";
                            }
                            if (ConsumerExpoMonth != "")
                            {
                                ConsumerExpoWhere += " and (Month(a.StartDate) = " + ConsumerExpoMonth + ")  ";
                            }
                            string ConsumerExpo = "";
                            DataTable ConsumerExpoTab = GetExpoList("消费品展会", ConsumerExpoWhere);
                            foreach (DataRow dr in ConsumerExpoTab.Rows)
                            {
                                ConsumerExpo += "<li>";
                                ConsumerExpo += "<p class=\"zi1\"><a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" class=\"l_c00\" href=\"#\">[" + dr["Type"] + "]</a> <a title=\"" + dr["Title"].ToString() + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"].ToString() + "</a></p>";
                                ConsumerExpo += "<p class=\"zi3\">[" + dr["Place"] + "]</p><p class=\"zi2\">" + dr["StartDate"] + "</p></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), ConsumerExpo);
                            break;
                        case "PB_UPEXPOLIST":
                            string upExpoStr = "";
                            DataTable UpExpoTab = GetExpo(" IsUp=1 ", 6);
                            int val = 1;
                            foreach (DataRow dr in UpExpoTab.Rows)
                            {
                                if (val == 1)
                                {

                                    upExpoStr += "<div class=\"czh\">";
                                    upExpoStr += "<p class=\"tit\"><a title=\"" + dr["Title"] + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"] + "</a></p>";
                                    upExpoStr += "<p><b>开始时间：</b>" + dr["StartDate"] + "</p>";
                                    upExpoStr += "<p><b>举办地点：</b>" + dr["Place"] + "</p>";
                                    //upExpoStr += "<p><b>联系电话：</b>021-785451235</p>";
                                    upExpoStr += "<p><b>展品范围：</b>" + dr["Type"] + "</p></div>";
                                    upExpoStr += "<ul class=\"cgs\">";
                                }
                                else
                                {
                                    upExpoStr += "<li>▪&nbsp;<a title=\"" + dr["Title"] + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"] + "</a></li>";
                                }
                                val++;
                            }
                            if (upExpoStr != "")
                            {
                                upExpoStr += "</ul>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), upExpoStr);
                            break;
                        case "PB_PUTEXPOLIST":
                            string putExpoStr = "";
                            DataTable putExpoTab = GetExpo(" IsPut=1 ", 8);
                            foreach (DataRow dr in putExpoTab.Rows)
                            {
                                putExpoStr += "<li><a title=\"" + dr["Title"] + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\"><img alt=\"" + dr["Title"] + "\" src=\"" + dr["Picture"].ToString() + "\" /></a><p><a title=\"" + dr["Title"] + "\" target=\"_blank\" href=\"{PB_WebURL}Expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"] + "</a></p><p>地点:" + dr["Place"] + "</p><p>时间:" + dr["StartDate"] + "</p></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), putExpoStr);
                            break;
                        case "PB_PUTPAVILION"://展馆推荐（广告）
                            string PavilionStr = "";
                            DataTable pavTab = GetAD(12, 21);
                            foreach (DataRow dr in pavTab.Rows)
                            {
                                PavilionStr += "<li><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a><span><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\">" + dr["Ad_MemberInfoName"] + "</a></span></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), PavilionStr);
                            break;
                        case "PB_EXPOINFO":  //展馆推荐（资讯）
                            string ExpoInfoStr = "";
                            DataTable ExpoInfoTab = GetConsultative(12, 18);
                            foreach (DataRow dr in ExpoInfoTab.Rows)
                            {
                                ExpoInfoStr += "<li><a title=\"" + dr["Title"] + "\" target=\"_blank\" href=\"{PB_WebURL}News/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\"><img alt=\"" + dr["Title"] + "\" src=\"" + dr["Picture"] + "\" /></a><span><a title=\"" + dr["Title"] + "\" target=\"_blank\" href=\"{PB_WebURL}News/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + dr["Title"] + "</a></span></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), ExpoInfoStr);
                            break;
                        case "PB_EXPOLISTAD":
                            string expolistAd = "";
                            DataTable expolistAdTab = GetAD(1, 23);
                            foreach (DataRow dr in expolistAdTab.Rows)
                            {
                                expolistAd += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img alt=\"" + dr["Ad_Leter"] + "\" width=\"" + dr["Ad_Width"] + "\" height=\"" + dr["Ad_Height"] + "\" src=\"{PB_WebURL}" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), expolistAd);
                            break;
                        case "PB_EXPOINDEXAD":
                            string expoindexAd = "";
                            DataTable expoindexAdTab = GetAD(1, 24);
                            foreach (DataRow dr in expoindexAdTab.Rows)
                            {
                                expoindexAd += "<p class=\"inxad mar_top\"><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img alt=\"" + dr["Ad_Leter"] + "\" width=\"" + dr["Ad_Width"] + "\" height=\"" + dr["Ad_Height"] + "\" src=\"{PB_WebURL}" + dr["Ad_ImageAdrees"] + "\" /></a></p>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), expoindexAd);
                            break;
                        case "PB_EXPOINFOAD":
                            string expoInfoAd = "";
                            DataTable expoInfoTab = GetAD(1, 25);
                            foreach (DataRow dr in expoInfoTab.Rows)
                            {
                                expoInfoAd += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img alt=\"" + dr["Ad_Leter"] + "\" width=\"" + dr["Ad_Width"] + "\" height=\"" + dr["Ad_Height"] + "\" src=\"{PB_WebURL}" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), expoInfoAd);
                            break;
                        case "PB_相关展会":
                            int ID = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                            {
                                ID = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            }
                            string reExpoStr = "";
                            DataTable reExpoTab = GetRelateExpo(ID);
                            foreach (DataRow dr in reExpoTab.Rows)
                            {
                                string newexpoTitle = dr["Title"].ToString();
                                if (newexpoTitle.ToString().Length > 17)
                                {
                                    newexpoTitle = newexpoTitle.Substring(0, 17);
                                }
                                reExpoStr += "<li>▪&nbsp;<a title=\"\" href=\"{PB_WebURL}expo/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + newexpoTitle + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), reExpoStr);
                            break;
                        case "PB_招商加盟首页广告":
                            string AgentAd = "";
                            DataTable AgentTab = GetAD(1, 26);
                            foreach (DataRow dr in AgentTab.Rows)
                            {
                                AgentAd += "<p class=\"cad1\"><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img alt=\"" + dr["Ad_Leter"] + "\"  width=\"" + dr["Ad_Width"] + "\" height=\"" + dr["Ad_Height"] + "\" src=\"{PB_WebURL}" + dr["Ad_ImageAdrees"] + "\" /></a></p>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), AgentAd);
                            break;
                        case "PB_代理图文信息":
                            string agentpicStr = "<ul class=\"ohtu\">";
                            DataTable agentpicTab = GetMessage("*","W_SincereAgent", "SinType=1 and Picture<>'' and verify=1 ", 2);
                            foreach (DataRow dr in agentpicTab.Rows)
                            {
                                agentpicStr += "<li><span class=\"tu\"><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Picture"].ToString()) + "\" /></a></span><span class=\"zi\"><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></span></li>";
                            }
                            agentpicStr += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), agentpicStr);
                            break;
                        case "PB_代理文字信息":
                            string agentStr = "<ul class=\"ohuod op\">";
                            DataTable agentTab = GetMerchants(6, " SinType=1 and verify=1 ");
                            foreach (DataRow dr in agentTab.Rows)
                            {
                                agentStr += "<li><a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebURL}Agent/Trade-" + dr["AgentType"].ToString() + Base.BasePage.Config.Rewrite + "\">[" + dr["tName"] + "]</a> <a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></li>";
                            }
                            agentStr += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), agentStr);
                            break;
                        case "PB_招商图文信息":
                            string merpicStr = "<ul class=\"ohtu\">";
                            DataTable merpicTab = GetMessage("*", "W_SincereAgent", "SinType=0 and Picture<>'' and verify=1  ", 2);
                            foreach (DataRow dr in merpicTab.Rows)
                            {
                                merpicStr += "<li><span class=\"tu\"><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Picture"].ToString()) + "\" /></a></span><span class=\"zi\"><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></span></li>";
                            }
                            merpicStr += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), merpicStr);
                            break;
                        case "PB_招商文字信息":
                            string merStr = "<ul class=\"ohuod op\">";
                            DataTable merTab = GetMerchants(6, " SinType=0 and verify=1 ");
                            foreach (DataRow dr in merTab.Rows)
                            {
                                merStr += "<li><a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebURL}Agent/Trade-" + dr["AgentType"].ToString() + Base.BasePage.Config.Rewrite + "\">[" + dr["tName"] + "]</a> <a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></li>";
                            }
                            merStr += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), merStr);
                            break;
                        case "PB_代理加盟分类":
                            string agentTypeStr = "";
                            DataTable fTypeTab = GetMessage("*", "W_AgentType", " ParentID=0 ", 0);
                            foreach (DataRow dr in fTypeTab.Rows)
                            {
                                DataTable sTypeTab = GetMessage("*", "W_AgentType", " ParentID=" + dr["ID"], 0);
                                agentTypeStr += "<div class=\"czs\">";
                                agentTypeStr += "<b><a title=\"\" href=\"{PB_WebURL}Agent/Trade-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></b>";
                                if (sTypeTab.Rows.Count != 0)
                                {
                                    agentTypeStr += "<p class=\"nr\">";
                                    foreach (DataRow dr2 in sTypeTab.Rows)
                                    {
                                        agentTypeStr += "<span><a title=\"\" href=\"{PB_WebURL}Agent/Trade-" + dr2["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr2["Name"] + "</a></span>";
                                    }
                                    agentTypeStr += "</p>";
                                }
                                agentTypeStr += "</div>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), agentTypeStr);
                            break;
                        case "PB_招商推荐":
                            string putSincereStr = "";
                            DataTable putSincereTab = GetMessage("*", "W_SincereAgent", " SinType=0 and verify=1 and Recommend=1  ", 12);
                            putSincereStr += "<ul class=\"czs2\">";
                            foreach (DataRow dr in putSincereTab.Rows)
                            {
                                putSincereStr += "<li><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Picture"].ToString()) + "\" /></a>";
                                putSincereStr += "<span><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></span></li>";
                            }
                            putSincereStr += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), putSincereStr);
                            break;
                        case "PB_代理推荐":
                            string putAgentStr = "";
                            DataTable putAgentTab = GetMessage("*", "W_SincereAgent", " SinType=1 and verify=1 and Recommend=1  ", 12);
                            putAgentStr += "<ul class=\"czs2\">";
                            foreach (DataRow dr in putAgentTab.Rows)
                            {
                                putAgentStr += "<li><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Picture"].ToString()) + "\" /></a>";
                                putAgentStr += "<span><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></span></li>";
                            }
                            putAgentStr += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), putAgentStr);
                            break;
                        case "PB_招商加盟列表广告":
                            string zsjmAdStr = "";
                            DataTable zsjmAdTab=GetAD(1,27);
                            foreach (DataRow dr in zsjmAdTab.Rows)
                            {
                                zsjmAdStr += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img alt=\"" + dr["Ad_Leter"] + "\"  width=\"" + dr["Ad_Width"] + "\" height=\"" + dr["Ad_Height"] + "\" src=\"{PB_WebURL}" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), zsjmAdStr);
                            break;
                        case "PB_招商加盟分类页":
                            //取得页尺寸
                            int pagesize = 10;
                            int OrderType = 1;
                            int PageID = 1;  //x
                            string strWhere = " 1=1 ";
                            string strTabelName = "  [W_SincereAgent] as a left join U_UserInfo as b on a.UserID=b.UserID left join W_AgentType as c on a.AgentType=c.ID  ";
                            string strFldName = "AddDate";
                            string strSelect = " a.*,b.CompanyName,b.Province,b.City,c.*,b.LoginName ";
                            string aName = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["sName"] != null)
                            {
                                aName = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["sName"]);
                            }
                            if (Function.CheckQueryStringisInt("Page"))
                            {
                                PageID = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["Page"]);
                            }
                            int typeId = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                                typeId = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            if (typeId != 0)
                            {
                                Agent.TAgentType SItems = new Agent.RAgentType().GateItem(typeId);
                                if (SItems != null && SItems.ParentID == 0)
                                {
                                    strWhere += " and (ParentID=" + typeId + " or AgentType=" + typeId + ")";
                                }
                                else
                                {
                                    strWhere += " and AgentType=" + typeId;
                                }
                            }

                            if (aName != "")
                            {
                                strWhere += " and a.Name like '%" + aName + "%' ";
                            }

                            string zsjmListStr = "<ul class=\"clit\">";
                            DataTable zsjmListTab = Pagination.GetDataTable(strWhere, strTabelName, OrderType, strFldName, strSelect, pagesize, PageID, 0, "a.id");
                            int l = 0;
                            foreach (DataRow dr in zsjmListTab.Rows)
                            {
                                zsjmListStr += "<li>";
                                zsjmListStr += "<p class=\"cw1\"><input id=\"compareBox" + l + "\" type=\"checkbox\" value=\"\" name=\" " +dr["ID"].ToString() + " \" onclick=\"clickcompareBox(" + dr["id"].ToString() + ",this)\" memberId=\"stfseal\"></p>";
                                zsjmListStr += "<p class=\"clt cw2\"><img alt=\"\" src=\"" + dr["Picture"] + "\" /></p>";
                                zsjmListStr += "<p class=\"clt cw3 mar_lt\">";
                                zsjmListStr += "<span><b>"+dr["Name"]+"</b> <font class=\"f_999\">"+dr["AddDate"]+"</font></span>";
                                zsjmListStr += "<span class=\"f_999\">" + dr["Title"] + "<a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"] + BasePage.Config.Rewrite + "\">[查看详情]</a></span>";
                                zsjmListStr += "<span>";
                                zsjmListStr += "<em class=\"cclt\"><a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"{PB_WebUrl}Shops/index/" + dr["LoginName"] + BasePage.Config.Rewrite + "\">" + dr["CompanyName"] + "</a></em>";
                                zsjmListStr += "<em class=\"ccrt\">" + dr["Province"] + " " + dr["City"] + "</em>";
                                zsjmListStr += "</span></p>";
                                zsjmListStr += "<p class=\"clt cw4 mar_lt\">";
                                zsjmListStr += "<b>信用度</b><b class=\"f_c00\">116</b></p>";
                                zsjmListStr += "<p class=\"clt cw5 mar_lt\">";
                                zsjmListStr += "<span class=\"cw5b1\"><a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"#\">联系方式</a></span>";
                                zsjmListStr += "<span class=\"cw5b2\"><a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"#\">点此询价</a></span>";
                                zsjmListStr += "<span><img alt=\"名企会员\" src=\"{PB_WebURL}images/mqhy.gif\" /></span>";
                                zsjmListStr += "</p></li>";
                                l++;
                            }
                            zsjmListStr += "</ul>";
                            zsjmListStr += "<div class=\"ltnr3 mar_top\"><p class=\"w8\"></p>";
                            zsjmListStr += "<p class=\"w4\"><input type=\"button\" class=\"soso\" value=\"批量留言\" /></p>";
                            zsjmListStr += "<p class=\"w6\"><input type=\"button\" class=\"qink\" value=\"清空全部选择\" /></p>";
                            zsjmListStr += "<p class=\"w7\"><a title=\"\" target=\"_blank\" class=\"l_c00_u\" href=\"{PB_WebURL}member/index" + BasePage.Config.Rewrite + "\">立即发布招商加盟信息</a></p>";
                            zsjmListStr += "</div>";
                            string strUrl = "{PB_WebURL}Agent/Trade";
                            if (PageID <= 0) PageID = 1;
                                
                            strUrl += "-p";
                            string Pages = Pagination.GoToPager(PageID, pagesize, strUrl, strWhere, strTabelName);
                            zsjmListStr += Pages;
                            strInfo = strInfo.Replace(strArray[i].ToString(), zsjmListStr);
                            break;
                        case "PB_招商搜索信息":
                            string strSql = " 1=1 ";
                            string TabelNamestr = "  [W_SincereAgent] as a left join U_UserInfo as b on a.UserID=b.UserID left join W_AgentType as c on a.AgentType=c.ID  ";
                            string tName = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["sName"] != null)
                            {
                                tName = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["sName"]);
                            }
                            if (Function.CheckQueryStringisInt("Page"))
                            {
                                PageID = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["Page"]);
                            }
                            int tId = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                                tId = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            if (tId != 0)
                            {
                                Agent.TAgentType SItems = new Agent.RAgentType().GateItem(tId);
                                if (SItems != null && SItems.ParentID == 0)
                                {
                                    strSql += " and ParentID=" + tId;
                                }
                                else
                                {
                                    strSql += " and AgentType=" + tId;
                                }
                            }

                            if (tName != "")
                            {
                                strSql += " and a.Name like '%" + tName + "%' ";
                            }
                            DataTable Agentdt = GetMessage("*", TabelNamestr, strSql, 0);
                            string thstr = "<p class=\"hd_rt\">共找到 <font class=\"f_c00\">" + Agentdt.Rows.Count.ToString() + "</font> 条信息";
                            if (tName != "")
                            {
                                thstr += "符合 <font class=\"f_c00\">“" + tName + "”</font> 的查询结果</p>";
                            }

                            strInfo = strInfo.Replace(strArray[i].ToString(), thstr);
                            break;
                        case "PB_分页信息":
                            string strSql2 = " 1=1 ";
                            string TabelNamestr2 = "  [W_SincereAgent] as a left join U_UserInfo as b on a.UserID=b.UserID left join W_AgentType as c on a.AgentType=c.ID  ";
                            string tName2 = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["sName"] != null)
                            {
                                tName2 = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["sName"]);
                            }
                            PageID = 1;
                            if (Function.CheckQueryStringisInt("Page"))
                            {
                                PageID = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["Page"]);
                            }
                            if (PageID <= 0) PageID = 1;
                            int tId2 = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                                tId2 = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            if (tId2 != 0)
                            {
                                Agent.TAgentType SItems2 = new Agent.RAgentType().GateItem(tId2);
                                if (SItems2 != null && SItems2.ParentID == 0)
                                {
                                    strSql2 += " and ParentID=" + tId2;
                                }
                                else
                                {
                                    strSql2 += " and AgentType=" + tId2;
                                }
                            }

                            if (tName2 != "")
                            {
                                strSql2 += " and a.Name like '%" + tName2 + "%' ";
                            }

                            DataTable Agentdt2 = GetMessage("*", TabelNamestr2, strSql2, 0);
                            int pagecount = int.Parse(Agentdt2.Rows.Count.ToString());

                            int sPage = PageID - 1;
                            int xPage = PageID + 1;
                            if (sPage < 1)
                            {
                                sPage = 1;
                            }
                            if (xPage > (int)Math.Ceiling((double)pagecount / 10))
                            {
                                xPage = (int)Math.Ceiling((double)pagecount / 10);
                            }
                            string thstr2 = "<em>共<b class=\"f_c00\">" + Agentdt2.Rows.Count.ToString() + "</b>条</em>";
                            string pageurl1 = "{PB_WebURL}Agent/Trade";
                            if (tName2 != "")
                            {
                                pageurl1 += ".aspx?Page=" + sPage + "&sName=" + tName2;
                                if (tId2 != 0)
                                {
                                    pageurl1 += "&ID=" + tId2;
                                }
                            }
                            else
                            {
                                if (tId2 != 0)
                                {
                                    pageurl1 += "-" + tId2;
                                }
                                pageurl1 += "-p" + sPage + Base.BasePage.Config.Rewrite;
                            }


                            string pageurl2 = "{PB_WebURL}Agent/Trade";
                            if (tId2 != 0)
                            {
                                pageurl2 += "-" + tId2;
                            }
                            pageurl2 += "-p" + xPage + Base.BasePage.Config.Rewrite;
                            if (tName2 != "")
                            {
                                pageurl2 = "{PB_WebURL}Purchase/Trade.aspx?sName=" + System.Web.HttpUtility.UrlEncode(System.Web.HttpContext.Current.Request.QueryString["sName"]) + "&Page=" + xPage;
                                if (tId2 != 0)
                                {
                                    pageurl2 += "&ID=" + tId2;
                                }
                            }

                            
                            thstr2 += "<em>" + PageID + "/" + (int)Math.Ceiling((double)pagecount / 10) + "</eM>";

                            thstr2 += "<em class=\"lt\"><a title=\"\" href=\"" + pageurl1 + "\"></a></em>";
                            thstr2 += "<em class=\"rt\"><a title=\"\" href=\"" + pageurl2+ "\">下一页</a></em>";

                            strInfo = strInfo.Replace(strArray[i].ToString(), thstr2);
                            break;
                        case "PB_COOKIENAME":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetCookie("LoginName"));
                            break;
                        case "PB_最新招商加盟信息":
                            string newzsjmStr = "";
                            DataTable newzsjmTab = GetMessage("*", "W_SincereAgent", " Verify=1 ", 10);
                            foreach (DataRow dr in newzsjmTab.Rows)
                            {
                                newzsjmStr += "<li>▪&nbsp;<a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"] + BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), newzsjmStr);
                            break;
                        case "PB_招商同类商品":
                            string similarzsStr = "";
                            int zsID = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                            {
                                zsID = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            }
                            DataTable similarzsTab = GetMessage("a.*", "W_SincereAgent as a left join W_SincereAgent as b on a.UserID=b.UserID ", " b.id=" + zsID, 0);
                            foreach (DataRow dr in similarzsTab.Rows)
                            {
                                similarzsStr += "<li>";
                                similarzsStr += "<p class=\"tu\">";
                                similarzsStr += "<a title=\"" + dr["Name"] + "\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"] + BasePage.Config.Rewrite + "\"><img alt=\"" + dr["Name"] + "\" src=\"" + dr["Picture"].ToString() + "\" /></a>";
                                similarzsStr += "</p>";
                                similarzsStr += "<p class=\"zi\"><a title=\"" + dr["Name"] + "\" href=\"{PB_WebURL}Agent/Detail-" + dr["ID"] + BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></p>";
                                similarzsStr += "</li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), similarzsStr);
                            break;
                        case "PB_知道首页广告": //知道首页广告
                            string knowIndexAdStr = "";
                            DataTable knowIndexAdTab = GetAD(1, 28);
                            foreach (DataRow dr in knowIndexAdTab.Rows)
                            {
                                knowIndexAdStr += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), knowIndexAdStr);
                            break;
                        case "PB_知道首页问答排行":
                            string knowIndexRandStr = "";
                            DataTable knowIndexRandTab = GetMessage("*", "W_KnowProblems", " Verify=1 ORDER BY AnswerCount DESC, AddDate DESC ", 10);
                            int knowOrder = 1;
                            foreach (DataRow dr in knowIndexRandTab.Rows)
                            {
                                knowIndexRandStr += "<li><em class=\"tu\">" + knowOrder.ToString() + "</em><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Know/Detail-" + dr["ID"] + BasePage.Config.Rewrite + "\">" + dr["Caption"] + "</a></li>";
                                knowOrder++;
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), knowIndexRandStr);
                            break;
                        case "PB_知道列表页待解决问题":
                            StringBuilder ReBulider = new StringBuilder();
                            StringBuilder knowliststrWhere = new StringBuilder();
                            string knowliststrSelect;
                            string knowliststrUrl = "{PB_WebURL}Know/Trade";
                            string knowTypeID = "0";
                            string table = "W_KnowProblems as a inner join W_KnowType b on a.TypeID=b.ID";
                            knowliststrSelect = "a.ID,a.UserName,a.Caption,a.AddDate,a.AnswerCount,a.State,b.Name";
                            string Title = "";
                            int PageSize = 1;        //每页显示几条
                            PageSize = 15;
                            int PageIndex = 1;        //第几页
                            if (System.Web.HttpContext.Current.Request.QueryString["Page"] != null || System.Web.HttpContext.Current.Request.QueryString["Page"] != "")
                                PageIndex = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["Page"]);
                            if (PageIndex < 1) PageIndex = 1;
                            knowliststrWhere.Append(" State=0 ");
                            if (Function.CheckQueryStringisInt("ID"))
                            {
                                string knowliststrSql = "";
                                knowTypeID = System.Web.HttpContext.Current.Request.QueryString["ID"];
                                if (knowTypeID != "0")
                                {
                                    DataTable dt2 = Function.GetDataTable("SELECT ID FROM W_KnowType WHERE ParentID=" + knowTypeID);
                                    if (dt2.Rows.Count != 0)
                                    {
                                        for (int knowlisto = 0; knowlisto < dt2.Rows.Count; knowlisto++)
                                        {
                                            knowliststrSql += dt2.Rows[knowlisto]["ID"].ToString() + ",";
                                        }
                                        knowliststrSql += knowTypeID;
                                        knowliststrWhere.Append(" and TypeID in (" + knowliststrSql + ")");
                                    }
                                    else
                                    {
                                        knowliststrWhere.Append(" and TypeID=" + knowTypeID);
                                    }
                                }
                                if (knowTypeID != "0")
                                    knowliststrUrl += "-" + knowTypeID;
                            }
                            if (System.Web.HttpContext.Current.Request.QueryString["sName"] != null && System.Web.HttpContext.Current.Request.QueryString["sName"] != "")
                            {
                                Title = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["sName"]);
                                knowliststrWhere.Append(" and  a.Caption like '%" + Title + "%'");
                            }
                            ReBulider.Append("<ul class=\"cqac\">");
                            DataTable Lists = Pagination.GetDataTable(knowliststrWhere.ToString(), table, 1, "a.AddDate", knowliststrSelect, PageSize, PageIndex, 0);
                            if (Lists.Rows.Count < 0)
                            {
                                ReBulider.Append("暂无此类产品");
                            }
                            else
                            {
                                foreach (DataRow dr in Lists.Rows)
                                {
                                    ReBulider.Append("<li>");
                                    ReBulider.Append("<p class=\"clt\">▪&nbsp;<a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Know/Detail-" + dr["ID"] + BasePage.Config.Rewrite + "\">" + dr["Caption"] +   "</a></p>");
                                    ReBulider.Append("<p class=\"crt\">回答次数：" + dr["AnswerCount"] + " 提问时间：" + dr["AddDate"].ToString() + "</p>");
                                    ReBulider.Append("</li>");
                                }
                            }
                            ReBulider.Append("</ul>");
                            knowliststrUrl = Base.BasePage.Config.WebURL + "know/trade" + Base.BasePage.Config.Rewrite + "?ID=" + knowTypeID + "";
                            if (Title != "")
                            {
                                knowliststrUrl += "&sName=" + Title;    
                            }
                            knowliststrUrl += "&Page=";
                            string strPagion = Pagination.GoToPager(PageIndex, PageSize, knowliststrUrl, knowliststrWhere.ToString(), table);
                            ReBulider.Append(strPagion);
                            strInfo = strInfo.Replace(strArray[i].ToString(), ReBulider.ToString());
                            break;
                        case "PB_知道列表页已解决问题":
                            StringBuilder ReBulider2 = new StringBuilder();
                            StringBuilder knowliststrWhere2 = new StringBuilder();
                            string knowliststrSelect2;
                            string knowliststrUrl2 = "{PB_WebURL}Know/Trade";
                            string knowTypeID2 = "0";
                            string table2 = "W_KnowProblems as a inner join W_KnowType b on a.TypeID=b.ID";
                            knowliststrSelect2 = "a.ID,a.UserName,a.Caption,a.AddDate,a.AnswerCount,a.State,b.Name";
                            string Title2 = "";
                            int PageSize2 = 1;        //每页显示几条
                            PageSize2 = 15;
                            int PageIndex2 = 1;        //第几页
                            if (System.Web.HttpContext.Current.Request.QueryString["Page"] != null || System.Web.HttpContext.Current.Request.QueryString["Page"] != "")
                                PageIndex2 = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["Page"]);
                            if (PageIndex2 < 1) PageIndex2 = 1;
                            knowliststrWhere2.Append(" State=1 ");
                            if (Function.CheckQueryStringisInt("ID"))
                            {
                                string knowliststrSql2 = "";
                                knowTypeID2 = System.Web.HttpContext.Current.Request.QueryString["ID"];
                                if (knowTypeID2 != "0")
                                {
                                    DataTable dt3 = Function.GetDataTable("SELECT ID FROM W_KnowType WHERE ParentID=" + knowTypeID2);
                                    if (dt3.Rows.Count != 0)
                                    {
                                        for (int knowlisto2 = 0; knowlisto2 < dt3.Rows.Count; knowlisto2++)
                                        {
                                            knowliststrSql2 += dt3.Rows[knowlisto2]["ID"].ToString() + ",";
                                        }
                                        knowliststrSql2 += knowTypeID2;
                                        knowliststrWhere2.Append(" and TypeID in (" + knowliststrSql2 + ")");
                                    }
                                    else
                                    {
                                        knowliststrWhere2.Append(" and TypeID=" + knowTypeID2);
                                    }
                                }
                                if (knowTypeID2 != "0")
                                    knowliststrUrl2 += "-" + knowTypeID2;
                            }
                            if (System.Web.HttpContext.Current.Request.QueryString["sName"] != null && System.Web.HttpContext.Current.Request.QueryString["sName"] != "")
                            {
                                Title2 = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["sName"]);
                                knowliststrWhere2.Append(" and  a.Caption like '%" + Title2 + "%'");
                            }
                            ReBulider2.Append("<ul class=\"cqac\">");
                            DataTable Lists2 = Pagination.GetDataTable(knowliststrWhere2.ToString(), table2, 1, "a.AddDate", knowliststrSelect2, PageSize2, PageIndex2, 0);
                            if (Lists2.Rows.Count < 0)
                            {
                                ReBulider2.Append("暂无此类产品");
                            }
                            else
                            {
                                foreach (DataRow dr in Lists2.Rows)
                                {
                                    ReBulider2.Append("<li>");
                                    ReBulider2.Append("<p class=\"clt\">▪&nbsp;<a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Know/Detail-" + dr["ID"] + BasePage.Config.Rewrite + "\">" + dr["Caption"] + "</a></p>");
                                    ReBulider2.Append("<p class=\"crt\">回答次数：" + dr["AnswerCount"] + " 提问时间：" + dr["AddDate"].ToString() + "</p>");
                                    ReBulider2.Append("</li>");
                                }
                            }
                            ReBulider2.Append("</ul>");
                            knowliststrUrl2 = Base.BasePage.Config.WebURL + "know/trade" + Base.BasePage.Config.Rewrite + "?ID=" + knowTypeID2 + "";
                            if (Title2 != "")
                            {
                                knowliststrUrl2 += "&sName=" + Title2;
                            }
                            knowliststrUrl2 += "&Page=";
                            string strPagion2 = Pagination.GoToPager(PageIndex2, PageSize2, knowliststrUrl2, knowliststrWhere2.ToString(), table2);
                            ReBulider2.Append(strPagion2);
                            strInfo = strInfo.Replace(strArray[i].ToString(), ReBulider2.ToString());
                            break;
                        case "PB_知道列表搜索关键字":
                            string knowkeyword = "请输入展会关键字";
                            if (System.Web.HttpContext.Current.Request.QueryString["sName"] != null && System.Web.HttpContext.Current.Request.QueryString["sName"] != "")
                            {
                                knowkeyword = System.Web.HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.QueryString["sName"]);
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), knowkeyword.ToString());
                            break;
                        case "PB_供应首页重点推荐":
                            strInfo = strInfo.Replace(strArray[i].ToString(), SupplierPut(4));
                            break;
                        case "PB_求购首页重点推荐":
                            strInfo = strInfo.Replace(strArray[i].ToString(), PurchasePut(4));
                            break;
                        case "PB_供应首页顶部广告":
                            string supplyIndexAdStr1 = "";
                            DataTable supplyIndexAdTab1 = GetAD(1, 29);
                            foreach (DataRow dr in supplyIndexAdTab1.Rows)
                            {
                                supplyIndexAdStr1 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), supplyIndexAdStr1);
                            break;
                        case "PB_最新供应信息":
                            string newsupplyIndexStr = "";
                            DataTable newsupplyTab = GetZDGQInfo(10, "C_Supply", 1);
                            foreach (DataRow dr in newsupplyTab.Rows)
                            {
                                newsupplyIndexStr += "<li>▪&nbsp;<a title=\"\" target=\"_blank\" href=\"{PB_WebUrl}Supply/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), newsupplyIndexStr);
                            break;
                        case "PB_供应首页右边广告1":
                            string supplyIndexAdStr2 = "";
                            DataTable supplyIndexAdTab2 = GetAD(1, 30);
                            foreach (DataRow dr in supplyIndexAdTab2.Rows)
                            {
                                supplyIndexAdStr2 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), supplyIndexAdStr2);
                            break;
                        case "PB_供应首页右边广告2":
                            string supplyIndexAdStr3 = "";
                            DataTable supplyIndexAdTab3 = GetAD(1, 31);
                            foreach (DataRow dr in supplyIndexAdTab3.Rows)
                            {
                                supplyIndexAdStr3 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), supplyIndexAdStr3);
                            break;
                        case "PB_供应首页右边广告3":
                            string supplyIndexAdStr4 = "";
                            DataTable supplyIndexAdTab4 = GetAD(1, 32);
                            foreach (DataRow dr in supplyIndexAdTab4.Rows)
                            {
                                supplyIndexAdStr4 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), supplyIndexAdStr4);
                            break;
                        case "PB_供应首页热门供应":
                            string hotSupplyStr = "";
                            DataTable hotSupplyTab = GetHotSupplyInType(20);
                            hotSupplyStr += "<ul class=\"chot\">";
                            foreach (DataRow dr in hotSupplyTab.Rows)
                            {
                                string intypename = dr["Type"].ToString();
                                if (intypename.Length > 6)
                                {
                                    intypename = intypename.ToString().Substring(0, 6);
                                }

                                hotSupplyStr += "<li><a title=\"" + dr["Type"].ToString() + "\" target=\"_blank\" href=\"{PB_WebUrl}Supply/Trade-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + intypename + "</a></li>";
                            }
                            hotSupplyStr+="</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), hotSupplyStr);
                            break;
                        case "PB_求购首页顶部广告":
                            string purchaseIndexAdStr1 = "";
                            DataTable purchaseIndexAdTab1 = GetAD(1, 33);
                            foreach (DataRow dr in purchaseIndexAdTab1.Rows)
                            {
                                purchaseIndexAdStr1 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), purchaseIndexAdStr1);
                            break;
                        case "PB_求购首页右边广告1":
                            string purchaseIndexAdStr2 = "";
                            DataTable purchaseIndexAdTab2 = GetAD(1, 34);
                            foreach (DataRow dr in purchaseIndexAdTab2.Rows)
                            {
                                purchaseIndexAdStr2 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), purchaseIndexAdStr2);
                            break;
                        case "PB_求购首页右边广告2":
                            string purchaseIndexAdStr3 = "";
                            DataTable purchaseIndexAdTab3 = GetAD(1, 35);
                            foreach (DataRow dr in purchaseIndexAdTab3.Rows)
                            {
                                purchaseIndexAdStr3 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), purchaseIndexAdStr3);
                            break;
                        case "PB_求购首页右边广告3":
                            string purchaseIndexAdStr4 = "";
                            DataTable purchaseIndexAdTab4 = GetAD(1, 36);
                            foreach (DataRow dr in purchaseIndexAdTab4.Rows)
                            {
                                purchaseIndexAdStr4 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), purchaseIndexAdStr4);
                            break;
                        case "PB_热门求购":
                            string hotPurchaseStr = "";
                            DataTable hotPurchaseTab = GetHotPurchaseInType(20);
                            hotPurchaseStr += "<ul class=\"chot\">";
                            foreach (DataRow dr in hotPurchaseTab.Rows)
                            {
                                string intypename = dr["Type"].ToString();
                                if (intypename.Length > 6)
                                {
                                    intypename = intypename.ToString().Substring(0, 6);
                                }

                                hotPurchaseStr += "<li><a title=\"" + dr["Type"].ToString() + "\" target=\"_blank\" href=\"{PB_WebUrl}Supply/Trade-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + intypename + "</a></li>";
                            }
                            hotPurchaseStr += "</ul>";
                            strInfo = strInfo.Replace(strArray[i].ToString(), hotPurchaseStr);
                            break;
                        case "PB_最新求购信息":
                            string newpurchaseStr = "";
                            DataTable newpurchaseTab = GetZDGQInfo(10, "C_Purchase", 1);
                            foreach (DataRow dr in newpurchaseTab.Rows)
                            {
                                newpurchaseStr += "<li>▪&nbsp;<a title=\"\" target=\"_blank\" href=\"{PB_WebUrl}Purchase/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), newpurchaseStr);
                            break;
                        case "PB_人才页最新求购信息":
                            string newpurchaseStr2 = "";
                            DataTable newpurchaseTab2 = GetZDGQInfo(9, "C_Purchase", 1);
                            foreach (DataRow dr in newpurchaseTab2.Rows)
                            {
                                newpurchaseStr2 += "<li>▪&nbsp;<a title=\"\" target=\"_blank\" href=\"{PB_WebUrl}Purchase/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["Name"] + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), newpurchaseStr2);
                            break;

                        case "PB_公司库轮显广告":
                            string companyIndexAdStr = "";
                            DataTable companyIndexAdTab1 = GetAD(3, 37);
                            foreach (DataRow dr in companyIndexAdTab1.Rows)
                            {
                                companyIndexAdStr += "<div class=\"con\"><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a></div>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), companyIndexAdStr);
                            break;
                        case "PB_公司库首页中间广告":
                            string companyIndexAdStr2 = "";
                            DataTable companyIndexAdTab2 = GetAD(1, 38);
                            foreach (DataRow dr in companyIndexAdTab2.Rows)
                            {
                                companyIndexAdStr2 += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "px\" height=\"" + dr["Ad_Height"].ToString() + "px\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), companyIndexAdStr2);
                            break;
                        case "PB_主题企业广告":
                            string companyIndexAdStr3 = "";
                            DataTable companyIndexAdTab3 = GetAD(2, 39);
                            foreach (DataRow dr in companyIndexAdTab3.Rows)
                            {
                                companyIndexAdStr3 += "<li><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "\" height=\"" + dr["Ad_Height"].ToString() + "\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), companyIndexAdStr3);
                            break;
                        case "PB_今日企业":
                            string toadyCompanyStr = "";
                            DataTable toadyCompanyTab = GetMessage("UserID,LoginName,CompanyName,Industry ", "U_UserInfo", " Verify=1 order by RegDate desc", 9);
                            foreach (DataRow dr in toadyCompanyTab.Rows)
                            {
                                string itype = GetIndustryType(dr["Industry"].ToString());
                                toadyCompanyStr += "<li><a title=\"\" class=\"l_c00\" href=\"{PB_WebUrl}Company/Trade-" + dr["Industry"].ToString().Split(',')[0] + Base.BasePage.Config.Rewrite + "\">[" + itype + "]</a> <a title=\"\" target=\"_blank\" href=\"{PB_WebUrl}shop/index/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["CompanyName"] + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), toadyCompanyStr);
                            break;
                        case "PB_最新企业":
                            string newcompanystr = "";
                            DataTable NewCompanyTab = GetMessage("UserID,LoginName,CompanyName", "U_UserInfo", " Verify=1 ORDER BY RegDate DESC ", 10);
                            foreach (DataRow dr in NewCompanyTab.Rows)
                            {
                                newcompanystr += "<li>▪&nbsp;<a title=\"" + dr["CompanyName"] + "\" target=\"_blank\" href=\"{PB_WebUrl}shop/index/" + dr["LoginName"] + "\">" + dr["CompanyName"] + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), newcompanystr);
                            break;
                        case "PB_会员企业":
                            string GradeCompanyStr = "";
                            DataTable GradeCompanyTab = GetMessage("UserID,LoginName,CompanyName,Industry,U_VipGrade.Name as vipName,U_VipGrade.Flag ", " U_UserInfo left join dbo.U_VipGrade on U_UserInfo.GradeID=U_VipGrade.ID", " GradeID=2 AND Verify=1  ", 10);
                            foreach (DataRow dr in GradeCompanyTab.Rows)
                            {
                                GradeCompanyStr += "<li><p class=\"zi1\">▪&nbsp;<a title=\"" + dr["CompanyName"] + "\" target=\"_blank\" href=\"{PB_WebUrl}shop/index/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["CompanyName"].ToString()), 16) + "</a></p><p class=\"zi2\"><img alt=\"" + dr["vipName"] + "\" src=\"" + dr["Flag"].ToString() + "\" /></p></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), GradeCompanyStr);
                            break;
                        case "PB_会员企业首页":
                            string GradeCompanyStr2 = "";
                            DataTable GradeCompanyTab2 = GetMessage("UserID,LoginName,CompanyName,Industry,U_VipGrade.Name as vipName,U_VipGrade.Flag ", " U_UserInfo left join dbo.U_VipGrade on U_UserInfo.GradeID=U_VipGrade.ID", " GradeID=2 AND Verify=1  ", 8);
                            foreach (DataRow dr in GradeCompanyTab2.Rows)
                            {
                                GradeCompanyStr2 += "<li><p class=\"zi1\">▪&nbsp;<a title=\"" + dr["CompanyName"] + "\" target=\"_blank\" href=\"{PB_WebUrl}shop/index/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["CompanyName"].ToString()), 16) + "</a></p><p class=\"zi2\"><img src=\"" + dr["Flag"].ToString() + "\" /></p></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), GradeCompanyStr2);
                            break;
                        case "PB_区域市场_杭州":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetAreaMarket("杭州市", 5));
                            break;
                        case "PB_区域市场_宁波":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetAreaMarket("宁波市", 5));
                            break;
                        case "PB_区域市场_温州":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetAreaMarket("温州市", 5));
                            break;
                        case "PB_区域市场_嘉兴":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetAreaMarket("嘉兴市", 5));
                            break;
                        case "PB_区域市场_湖州":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetAreaMarket("湖州市", 5));
                            break;
                        case "PB_区域市场_绍兴":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetAreaMarket("绍兴市", 5));
                            break;
                        case "PB_公司库列表广告":
                            string companyListAdStr = "";
                            DataTable companyListAdTab = GetAD(1, 41);
                            foreach (DataRow dr in companyListAdTab.Rows)
                            {
                                companyListAdStr += "<li><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "\" height=\"" + dr["Ad_Height"].ToString() + "\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), companyListAdStr);
                            break;
                        case "PB_供应商精选":   //根据 供应商品的数量 取出前6
                            string SupplierPutStr = "";
                            DataTable SupplierPutTab = GetMessage(" a.UserID,a.CompanyName,count(b.ID) as scount,a.LoginName ", "dbo.U_UserInfo as a,dbo.C_Supply as b ", " a.UserID=b.UserID group by a.UserID,a.CompanyName,a.LoginName order by count(b.ID) desc ", 6);
                            foreach (DataRow dr in SupplierPutTab.Rows)
                            {
                                string scname=dr["CompanyName"].ToString();
                                if(scname.Length>20)
                                {
                                    scname=scname.Substring(0,20);
                                }

                                SupplierPutStr += "<li>▪&nbsp;<a title=\"" + dr["CompanyName"] + "\" target=\"_blank\" href=\"{PB_WebURL}Shop/Index/" + dr["LoginName"] + Base.BasePage.Config.Rewrite + "\">" + scname + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), SupplierPutStr);
                            break;
                        case "PB_采购精选":       //根据 求购商品的数量 取出前6

                            string PurchasePutStr = "";
                            DataTable PurchasePutTab = GetMessage(" a.UserID,a.CompanyName,count(b.ID) as scount,a.LoginName ", "dbo.U_UserInfo as a,dbo.C_Purchase as b ", " a.UserID=b.UserID group by a.UserID,a.CompanyName,a.LoginName order by count(b.ID) desc ", 6);
                            foreach (DataRow dr in PurchasePutTab.Rows)
                            {
                                string scname = dr["CompanyName"].ToString();
                                if (scname.Length > 20)
                                {
                                    scname = scname.Substring(0, 20);
                                }

                                PurchasePutStr += "<li>▪&nbsp;<a title=\"" + dr["CompanyName"] + "\" target=\"_blank\" href=\"{PB_WebURL}Shop/Index/" + dr["LoginName"] + Base.BasePage.Config.Rewrite + "\">" + scname + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), PurchasePutStr);
                            break;
                        case "PB_求助广场":
                            string squarestr = "";
                            DataTable sqTab = GetSquareList(1);
                            foreach (DataRow dr in sqTab.Rows)
                            {
                                string pDetail = dr["Caption"].ToString();
                                if (pDetail.Length > 12)
                                {
                                    pDetail = pDetail.Substring(0, 12);
                                }
                                string anDetail = dr["anDetail"].ToString();
                                if (anDetail.Length > 45)
                                {
                                    anDetail = anDetail.Substring(0, 45);
                                }
                                //squarestr += "<form id=\"Answer\" method=\"post\" action=\"{PB_weburl}Know/KnowAnswerAdd.aspx\">";
                                squarestr += "<b class=\"zt tu1\">"+pDetail+"</b>";
                                squarestr += "<p class=\"zt tu2\">" + anDetail + "……</p>";
                                squarestr += "<p class=\"zt2\">";
                                squarestr += "<em><input name=\"AnswerDetail\" id=\"AnswerDetail\" type=\"text\" class=\"input3\" onblur=\"if(this.value==''||this.value=='我来帮助您'){this.value='我来帮助您';this.className='input3';}\" onfocus=\"if(this.value=='我来帮助您'){this.value='';this.className='input2';}\" value=\"我来帮助您\" style=\"width:153px;\" /></em>";
                                squarestr += "<em><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}member/Know/KnowProblemsAdd.aspx?AskVal='+document.getElementById('AnswerDetail').value+'\"><img alt=\"我要求救\" src=\"images/wyqj.gif\" /></a></em>";
                                squarestr += "<em><a title=\"\" target=\"_blank\" href=\"{PB_WebURL}Know/Trade.aspx\"><img alt=\"我来回答\" src=\"images/wlhd.gif\" /></a></em></p>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), squarestr);
                            break;
                        case "PB_商家精选供应商":      // 根据发布类型为招商的 招商代理信息的数量 取出前6 sintype=0
                            string compSincereStr = "";
                            DataTable compSincereTab = GetcompSincere(0);
                            foreach (DataRow dr in compSincereTab.Rows)
                            {

                                compSincereStr += "<li>▪&nbsp;<a title=\"" + dr["CompanyName"] + "\" target=\"_blank\" href=\"" + Base.BasePage.Config.WebURL + "shops/index/" + dr["LoginName"] + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["CompanyName"].ToString()), 20) + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), compSincereStr);
                            break;
                        case "PB_商家精选代理商":   // 根据发布类型为代理的 招商代理信息的数量 取出前6 sintype=1
                            string compSincereStr2 = "";
                            DataTable compSincereTab2 = GetcompSincere(1);
                            foreach (DataRow dr in compSincereTab2.Rows)
                            {

                                compSincereStr2 += "<li>▪&nbsp;<a title=\"" + dr["CompanyName"] + "\" target=\"_blank\" href=\"" + Base.BasePage.Config.WebURL + "shops/index/" + dr["LoginName"] + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["CompanyName"].ToString()), 20) + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), compSincereStr2);
                            break;
                        case "PB_超级展厅":
                            string newExpoListStr = "";
                            DataTable newExpoListTab = GetNewExpo(8);
                            foreach (DataRow dr in newExpoListTab.Rows)
                            {
                                string newExpoIndtype = dr["Type"].ToString();
                                if (newExpoIndtype.Length > 5)
                                {
                                    newExpoIndtype = newExpoIndtype.Substring(0, 5);
                                }
                                string newExpoTitle = dr["Title"].ToString();
                                if (newExpoTitle.Length > 15)
                                {
                                    newExpoTitle = newExpoTitle.Substring(0, 15);
                                }
                                newExpoListStr += "<li><a title=\"" + dr["Type"] + "\" class=\"l_c00\" href=\"" + Base.BasePage.Config.WebURL + "expo/trade-" + dr["typeid"] + Base.BasePage.Config.Rewrite + "\">[" + newExpoIndtype + "]</a> <a title=\"" + dr["Title"] + "\" target=\"_blank\" href=\"" + Base.BasePage.Config.WebURL + "expo/detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + newExpoTitle + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), newExpoListStr);
                            break;
                        case "PB_供应详细页公司档案":
                            int PID = 0;
                            int userID = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                            {
                                PID = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);    
                            }
                            Product.TSupply Items = new Product.RSupply().GateItem(PID);
                            if (Items != null)
                            {
                                userID = Items.UserID;
                            }
                            string companyfilesStr = "";
                            DataTable companyfilesTab = Getcompanyfiles(userID);
                            foreach (DataRow dr in companyfilesTab.Rows)
                            { 
                                string compName = dr["CompanyName"].ToString();
                                if (compName.Length > 15)
                                {
                                    compName = compName.Substring(0, 15);
                                }
                                companyfilesStr += "<div class=\"spsrt\">";
                                companyfilesStr += "<p class=\"tit\">";
                                companyfilesStr += "<strong>" + dr["vipName"] + "<i class=\"tlt\"></i><i class=\"trt\"></i></strong>";
                                companyfilesStr += "<span>第 " +dr["regtime"] + " 年</span>";
                                companyfilesStr += "<i class=\"rt\"></i></p>";
                                companyfilesStr += "<div class=\"nr\">";
                                companyfilesStr += "<b class=\"nrzi\"><a title=\""+dr["CompanyName"]+"\" target=\"_blank\" href=\"" + Base.BasePage.Config.WebURL + "shops/Index/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\">" + compName + "</a></b>";
                                companyfilesStr += "<p class=\"nrzi\">经营模式：" + dr["BusinessModel"] + "</p>";
                                companyfilesStr += "<p class=\"nrzi\">供应产品数：" + dr["SupplyCount"] + "</p>";
                                companyfilesStr += "<p class=\"nrzi\">工商注册信息：已认证</p>";
                                companyfilesStr += "<p class=\"nrzi\">通过会员资质认证：100</p>";
                                companyfilesStr += "<p class=\"nrzi\">会员资格及年限：申请"+dr["vipName"]+"服务 "+dr["regtime"]+" 年</p>";
                                companyfilesStr += "<p class=\"nrzi\">诚信经营：28</p>";
                                companyfilesStr += "<p class=\"nrzi\">证书荣誉：" + dr["cercount"] + "</p>";
                                companyfilesStr += "<p class=\"nrzi\"><a title=\"最新供应\" href=\"" + Base.BasePage.Config.WebURL + "supply/trade" + Base.BasePage.Config.Rewrite + "?UserID=" + userID + "\">最新供应</a> <a title=\"信用档案\" href=\"" + Base.BasePage.Config.WebURL + "shop/importers/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\">信用档案</a> <a title=\"公司介绍\" href=\"" + Base.BasePage.Config.WebURL + "shops/Profile/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\">公司介绍</a></p>";
                                companyfilesStr += "<p class=\"nrzi\"></p>";
                                companyfilesStr += "<p class=\"nra\"><a title=\""+dr["CompanyName"]+"\" href=\"" + Base.BasePage.Config.WebURL + "shops/index/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Logo"].ToString()) + "\" /></a></p>";
                                companyfilesStr += "</div></div>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), companyfilesStr);
                            break;
                        case "PB_求购详细会员等级":
                            string purchaseCompName = "";
                            int PurchaseID = 0;
                            int purchaseUserID = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                            {
                                PurchaseID = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            }
                            Product.TPurchase PurchaseItems = new Product.RPurchase().GateItem(PurchaseID);
                            if (PurchaseItems != null)
                            {
                                purchaseUserID = PurchaseItems.UserID;
                            }
                            DataTable purchaseCompTab = Getcompanyfiles(purchaseUserID);
                            if (purchaseCompTab.Rows.Count != 0)
                            {
                                purchaseCompName = purchaseCompTab.Rows[0]["vipName"].ToString();
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), purchaseCompName);
                            break;
                        case "PB_收录企业":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetcompanyCount("").Rows.Count.ToString());
                            break;
                        case "PB_审核通过企业":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetcompanyCount(" Verify=1 ").Rows.Count.ToString());
                            break;
                        case "PB_今日收录":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetcompanyCount(" (datediff(dd,RegDate,getdate()))=0 ").Rows.Count.ToString());
                            break;
                        case "PB_供应信息数量":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetMessage("ID", "C_Supply", "", 0).Rows.Count.ToString());
                            break;
                        case "PB_求购信息数量":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetMessage("ID", "C_Purchase", "", 0).Rows.Count.ToString());
                            break;
                        case "PB_首页中部广告位1":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetADMsg(1, 42));
                            break;
                        case "PB_首页中部广告位2":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetADMsg(1, 43));
                            break;
                        case "PB_首页中部广告位3":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetADMsg(1, 44));
                            break;
                        case "PB_首页中部广告位4":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetADMsg(1, 45));
                            break;
                        case "PB_首页右端广告位":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetADMsg(1, 46));
                            break;
                        case "PB_市场展销":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetMarketSales(9));
                            break;
                        case "PB_相关市场展销":
                            int marksalesID = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                            {
                                marksalesID = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            }

                            strInfo = strInfo.Replace(strArray[i].ToString(), GetRelateMarketSales(marksalesID));
                            break;
                        case "PB_市场展销内容":
                                  int marksalesID2 = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                            {
                                marksalesID2 = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetMarkSaleMsg(marksalesID2));
                            break;
                        case "PB_市场展销标题":
                            int marksalesID3 = 0;
                            if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null)
                            {
                                marksalesID3 = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["ID"]);
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetMarkSaleTitle(marksalesID3));
                            break;
                        case "PB_公司基本投资额":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetCompanyAgentStr(1));
                            break;
                        case "PB_公司加盟费":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetCompanyAgentStr(2));
                            break;
                        case "PB_公司预计回报率":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetCompanyAgentStr(3));
                            break;
                        case "PB_热门招聘":
                            string HotJobAdStr = "";
                            DataTable HotJobAdTab = GetAD(9, 47);
                            foreach (DataRow dr in HotJobAdTab.Rows)
                            {
                                HotJobAdStr += "<li><a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "\" height=\"" + dr["Ad_Height"].ToString() + "\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), HotJobAdStr);
                            break;
                        case "PB_热门招聘信息":
                            string HotJobTypeStr = "";
                            DataTable HotJobTypeTab = GetHotJobType(20);
                            foreach (DataRow dr in HotJobTypeTab.Rows)
                            {
                                HotJobTypeStr += "<li><a title=\"" + dr["TypeName"] + "\" target=\"_blank\" href=\"{PB_WEBURL}Job/JobTrade-" + dr["ID"] + Base.BasePage.Config.Rewrite+ "\">" + Function.GetString(Base.Common.RemoveHTML(dr["TypeName"].ToString()), 7) + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), HotJobTypeStr);
                            break;
                        case "PB_人才首页广告":
                            strInfo = strInfo.Replace(strArray[i].ToString(), GetADMsg(1, 48));
                            break;
                        case "PB_JOB_PID":
                            string job_pid="";
                            if (System.Web.HttpContext.Current.Request.QueryString["pid"] != null && System.Web.HttpContext.Current.Request.QueryString["pid"].ToString() != "请选择省份")
                            {
                                job_pid = System.Web.HttpContext.Current.Request.QueryString["pid"].ToString();
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), job_pid);
                            break;
                        case "PB_JOB_CID":
                            string job_cid = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["cid"] != null)
                            {
                                job_cid = System.Web.HttpContext.Current.Request.QueryString["cid"].ToString();
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), job_cid);
                            break;
                        case "PB_JOB_AID":
                            string job_aid = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["aid"] != null)
                            {
                                job_aid = System.Web.HttpContext.Current.Request.QueryString["aid"].ToString();
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), job_aid);
                            break;
                        case "PB_JOBTYPELIST":
                            string jobtypelist = "";
                            Rjob rjb = new Rjob();
                            DataTable typelistTab = rjb.GetJobType();
                            foreach (DataRow dr in typelistTab.Rows)
                            {
                                jobtypelist += "<option value=\""+dr["ID"]+"\">"+dr["TypeName"]+"</option>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), jobtypelist);
                            break;
                        case "PB_ICONLINK":
                            strInfo = strInfo.Replace(strArray[i].ToString(), "<link rel=\"icon\" href=\"{PB_WebURL}favicon.ico\" type=\"image/x-icon\" />\r\n<link rel=\"shortcut icon\" href=\"{PB_WebURL}favicon.ico\" type=\"image/x-icon\" />\r\n");
                            break;
                        case "PB_供应热门行业":
                            string hotsupplylist = "";
                            Product.RSupply hotsy = new Product.RSupply();
                            DataTable hotsylist = hotsy.GetHotIndustry(24);
                            foreach (DataRow dr in hotsylist.Rows)
                            {
                                hotsupplylist += "<li><a title=\"" + dr["Type"] + "\" href=\"{PB_WEBURL}Supply/Trade-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + (dr["Type"].ToString().Length > 8 ? dr["Type"].ToString().Substring(0, 8) : dr["Type"].ToString()) + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), hotsupplylist);
                            break;
                        case "PB_求购热门行业":
                            string hotpurchase = "";
                            Product.RPurchase hotpc = new Product.RPurchase();
                            DataTable hotpclist = hotpc.GetHotIndustry(24);
                            foreach (DataRow dr in hotpclist.Rows)
                            {
                                hotpurchase += "<li><a title=\"" + dr["Type"] + "\" href=\"{PB_WEBURL}Purchase/Trade-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + (dr["Type"].ToString().Length > 8 ? dr["Type"].ToString().Substring(0, 8) : dr["Type"].ToString()) + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), hotpurchase);
                            break;
                        case "PB_公司热门行业":
                            string hotcompany = "";
                            DAL.Ad.MemberInfo minfo = new DAL.Ad.MemberInfo();
                            DataTable hotcomplist = minfo.GetHotIndustry(24);
                            foreach (DataRow dr in hotcomplist.Rows)
                            {
                                hotcompany += "<li><a title=\"" + dr["Type"] + "\" href=\"{PB_WEBURL}Company/Trade-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + (dr["Type"].ToString().Length > 8 ? dr["Type"].ToString().Substring(0, 8) : dr["Type"].ToString()) + "</a></li>";
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), hotcompany);
                            break;
                        case "PB_相关信息搜索":
                            string relatesearch = "";
                            if (System.Web.HttpContext.Current.Request.QueryString["sName"] != null)
                            {
                                string searchname = System.Web.HttpContext.Current.Request.QueryString["sName"].ToString();
                                if (!string.IsNullOrEmpty(searchname))
                                {
                                    searchname = System.Web.HttpUtility.UrlEncode(searchname);
                                    relatesearch = "<a title=\"{PR_CUR_keyword}供应信息\" target=\"_blank\" href=\"{PB_WebURL}supply/trade{PB_POSTFIX}?sName=" + searchname + "\">查看<em class=\"f_c00\">“{PR_CUR_keyword}”</em>供应信息</a>"
                                                 + " | <a title=\"{PR_CUR_keyword}求购信息\" target=\"_blank\" href=\"{PB_WebURL}purchase/trade{PB_POSTFIX}?sName=" + searchname + "\">查看<em class=\"f_c00\">“{PR_CUR_keyword}”</em>求购信息</a>"
                                                 + " | <a title=\"{PR_CUR_keyword}公司信息\" target=\"_blank\" href=\"{PB_WebURL}company/trade{PB_POSTFIX}?sName=" + searchname + "\">查看<em class=\"f_c00\">“{PR_CUR_keyword}”</em>公司信息</a><br/>"
                                                 + "<a title=\"{PR_CUR_keyword}招商信息\" target=\"_blank\" href=\"{PB_WebURL}agent/trade{PB_POSTFIX}?sName=" + searchname + "\">查看<em class=\"f_c00\">“{PR_CUR_keyword}”</em>招商信息</a>"
                                                 + " | <a title=\"{PR_CUR_keyword}展会信息\" target=\"_blank\" href=\"{PB_WebURL}expo/trade{PB_POSTFIX}?sName=" + searchname + "\">查看<em class=\"f_c00\">“{PR_CUR_keyword}”</em>展会信息</a>"
                                                 + " | <a title=\"{PR_CUR_keyword}招聘信息\" target=\"_blank\" href=\"{PB_WebURL}job/jobtrade{PB_POSTFIX}?sName=" + searchname + "\">查看<em class=\"f_c00\">“{PR_CUR_keyword}”</em>招聘信息</a>";
                                }
                            }
                            strInfo = strInfo.Replace(strArray[i].ToString(), relatesearch);
                            break;
                    }
                }
                catch (Exception ex)
                {
                    return ex.Message;
                }
            }

            return strInfo;
        }

        /// <summary>
        /// 区域市场生成
        /// </summary>
        /// <param name="areastr">区域</param>
        /// <param name="nums">数量</param>
        private string GetAreaMarket(string areastr, int nums)
        {
            DataTable areaTab = GetMessage("UserID,LoginName,CompanyName,Industry ", "U_UserInfo", " City='" + areastr + "'  ", nums);
            string rstr = "";

            foreach (DataRow dr in areaTab.Rows)
            {
                string itype = GetIndustryType(dr["Industry"].ToString());
                string ytype = itype;
                if (itype.ToString().Length > 6)
                {
                    itype = itype.Substring(0, 6);
                }
                rstr += "<p><a title=\"" + ytype + "\" class=\"l_c00\" href=\"{PB_WebUrl}Company/Trade-" + dr["Industry"].ToString().Split(',')[0] + Base.BasePage.Config.Rewrite + "\">[" + itype + "]</a> <a title=\"" + dr["CompanyName"] + "\" target=\"_blank\" href=\"{PB_WebUrl}shop/index/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\">" + dr["CompanyName"] + "</a></p>";
            }
            return rstr;
        }

        /// <summary>
        /// 获取区域连接
        /// </summary>
        /// <param name="url"></param>
        /// <param name="province"></param>
        /// <param name="city"></param>
        /// <param name="area"></param>
        private string GetAreaUrl(string url,string province, string city, string area)
        {
            StringBuilder sb = new StringBuilder();
            string s_area = Base.Common.GetString(city, 0, 3);
            sb.AppendFormat("<a title=\"{3}\" target=\"_blank\" class=\"l_c00\" href=\"{0}?pid={1}&cid={2}\">[{4}]</a>", url, System.Web.HttpUtility.UrlEncode(province), System.Web.HttpUtility.UrlEncode(city), province + " " + city, s_area);
            return sb.ToString();
            
        }

        /// <summary>
        /// 取得META信息
        /// </summary>
        /// <param name="Model"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private DataTable GetMetaKeyWords(string Model)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT * FROM [W_MetaInfo] where Type='" + Model+"'");
            return dt;
        }
        private string GetCompanyAgentStr(int typeid)
        {
            string strsql = "select top 7 a.*,b.UserID as comID,b.CompanyName,b.LoginName from w_SincereAgent as a left join dbo.U_UserInfo as b on a.UserID=b.UserID ";
            switch (typeid)
            { 
                case 1:
                    strsql += " order by a.Investment  desc ";
                    break;
                case 2:
                    strsql += " order by a.InitialFee  desc  ";
                    break;
                case 3:
                    strsql += " order by a.Payback desc ";
                    break;
            }
            string returnStr = "";

            DataTable dt = SqlHelper.ExecuteSqlQuery(strsql);

            int count = 1;
                if (typeid == 1)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        
                        string className="cpfc1";
                        if (count == 1)
                        {
                            className = "cpfc2";
                        }
                        int zsID = ReturnZSID(dr["LoginName"].ToString());
                        returnStr += "<li class=\"" + className + "\">";
                        returnStr += "<p class=\"tit\"><a title=\"" + dr["Name"] + "\" href=\"" + Base.BasePage.Config.WebURL + "Agent/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(dr["Name"].ToString(), 15) + "</a></p>";
                        returnStr += "<span class=\"pf\">基本投资额：" + dr["Investment"] + "</span>";
                        returnStr += "<span class=\"lj\"><a title=\"\" class=\"l_c00\" href=\"" + ZSSiteUrl + "promotion-" + zsID + ".html\">[立即推广]</a></span>";
                        returnStr += "<p class=\"mp\"><a title=\"\" href=\"#\"><img alt=\"\" src=\"" + ZSSiteUrl + "showcardimg_" + zsID + ".html\" /></a></p>";
                        returnStr += "</li>";
                        count++;
                    }
                }
                if (typeid == 2)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        string className = "cpfc1";
                        if (count == 1)
                        {
                            className = "cpfc2";
                        }
                        int zsID = ReturnZSID(dr["LoginName"].ToString());
                        returnStr += "<li class=\"" + className + "\">";
                        returnStr += "<p class=\"tit\"><a title=\"" + dr["Name"] + "\" href=\"" + Base.BasePage.Config.WebURL + "Agent/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(dr["Name"].ToString(), 15) + "</a></p>";
                        returnStr += "<span class=\"pf\">加盟费：" + dr["InitialFee"] + "</span>";
                        returnStr += "<span class=\"lj\"><a title=\"\" class=\"l_c00\" href=\"" + ZSSiteUrl + "promotion-" + zsID + ".html\">[立即推广]</a></span>";
                        returnStr += "<p class=\"mp\"><a title=\"\" href=\"#\"><img alt=\"\" src=\"" + ZSSiteUrl + "showcardimg_" + zsID + ".html\" /></a></p>";
                        returnStr += "</li>";
                        count++;
                    }
                }
                if (typeid == 3)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        string className = "cpfc1";
                        if (count == 1)
                        {
                            className = "cpfc2";
                        }
                        int zsID = ReturnZSID(dr["LoginName"].ToString());
                        returnStr += "<li class=\"" + className + "\">";
                        returnStr += "<p class=\"tit\"><a title=\"" + dr["Name"] + "\" href=\"" + Base.BasePage.Config.WebURL + "Agent/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(dr["Name"].ToString(),15) + "</a></p>";
                        returnStr += "<span class=\"pf\">预计回报率：" + dr["Payback"] + "%</span>";
                        returnStr += "<span class=\"lj\"><a title=\"\" class=\"l_c00\" href=\"" + ZSSiteUrl + "promotion-" + zsID + ".html\">[立即推广]</a></span>";
                        returnStr += "<p class=\"mp\"><a title=\"\" href=\"#\"><img alt=\"\" src=\"" + ZSSiteUrl + "showcardimg_" + zsID + ".html\" /></a></p>";
                        returnStr += "</li>";
                        count++;
                    }
                    
                }
            return returnStr;
        }

        private string GetMarkSaleTitle(int id)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery(" Select * from [C_MarketSales] where ID=" + id);
            string returnStr = "";
            if (dt.Rows.Count != 0)
            {
                returnStr = dt.Rows[0]["Title"].ToString();
            }
            return returnStr;
        }
        private string GetMarkSaleMsg(int id)
        {
            string returnStr = "";
            DataTable dt = SqlHelper.ExecuteSqlQuery(" Select * from [C_MarketSales] where ID=" + id);
            foreach (DataRow dr in dt.Rows)
            { 
                returnStr += "<div class=\"exs mar_top\">";
                returnStr += "<h2 class=\"exst\">" + Function.GetString(Base.Common.RemoveHTML(dr["Title"].ToString()), 25) + "</h2>";
                returnStr += "<div class=\"nr\">";
                returnStr += "<p><b>展会名称：</b>"+Base.Common.RemoveHTML(dr["Title"].ToString())+"</p>";
                returnStr += "<p><b>开幕日期：</b>" + dr["StartDate"] + "</p>";
                returnStr += "<p><b>闭幕日期：</b>" + dr["EndDate"] + "</p>";
                returnStr += "<p><b>主办单位：</b>" + dr["FrontFor"] + "</p>";
                returnStr += "<p><b>协办单位：</b>" + dr["Aidance"] + "</p>";
                returnStr += "<p><b>展会地址：</b>" + dr["Place"] + "</p>";
                returnStr += "<p><b>展会周期：</b>" + dr["Period"] + "</p>";
                returnStr += "<p><b>展会面积：</b>" + dr["ShowArea"] + "平方米</p>";
                returnStr += "<p><b>参展人数：</b>" + dr["Spectator"] + "人</p>";
                returnStr += "<p><b>展位单价：</b>" + dr["Price"] + "元/位</p>";
                returnStr += "<p></p>";
                returnStr += "<p><b>展会简介：</b>" + Base.Common.RemoveHTML(dr["Summary"].ToString()) + "</p>";
                returnStr += "<p><b>展会范围：</b>" + dr["Range"] + "</p>";
                returnStr += "</div></div>";
            }
            return returnStr;
        }
        
        //根据广告位获取广告信息
        private string  GetADMsg(int num, int adtypeID)
        {
            string returnMsg = "";
            DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT top " + num + " a.*,b.Ad_Width,b.Ad_Height FROM [W_Ad_MemberInfo] as a, [W_Ad_Table] as b WHERE a.T_ID=b.T_ID and a.T_ID=" + adtypeID);
            foreach (DataRow dr in dt.Rows)
            {
                returnMsg += "<a title=\"" + dr["Ad_Leter"] + "\" target=\"_blank\" href=\"" + dr["Ad_Adrees"] + "\"><img width=\"" + dr["Ad_Width"].ToString() + "\" height=\"" + dr["Ad_Height"].ToString() + "\" alt=\"" + dr["Ad_Leter"] + "\" src=\"" + dr["Ad_ImageAdrees"] + "\" /></a>";
            }
            return returnMsg;
        }
        private string GetMarketSales(int num)
        {
            string returnMsg = "";
            DataTable dt = SqlHelper.ExecuteSqlQuery("select top "+num+" a.*,b.companyName,b.LoginName from dbo.C_MarketSales as a  left join dbo.U_UserInfo as b on a.UserID=b.UserID  where  a.Verify=1 and (datediff(hh,a.EndDate,getdate())<0)  order by AddDate desc");
            int scount = 1;
            foreach (DataRow dr in dt.Rows)
            {
                if (scount == 1)
                {
                    returnMsg += "<div class=\"czhnr\">";
                    returnMsg += "<a title=\"\" target=\"_blank\" href=\"" + Base.BasePage.Config.WebURL + "MarketSales/Detail.aspx?id="+dr["ID"]+"\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Picture"].ToString()) + "\" /></a>";
                    returnMsg += "<b><a title=\"" + dr["Title"] + "\" target=\"_blank\" href=\"" + Base.BasePage.Config.WebURL + "MarketSales/Detail.aspx?id=" + dr["ID"] + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["Title"].ToString()), 15) + "</a></b>";
                    returnMsg += "<form id=\"MarketSales" + scount + "\" method=\"post\" action=\"{PB_weburl}Member/MarketSales/RcountAdd.aspx\"><p><a title=\"" + dr["CompanyName"] + "\" target=\"_blank\"  href=\"" + Base.BasePage.Config.WebURL + "shops/index/" + dr["LoginName"].ToString() + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["CompanyName"].ToString()), 15) + "</a> <input id=\"submit\" type=\"submit\" value=\"报名\"  /><input type=\"hidden\" name=\"mid\" value=\"" + dr["ID"] + "\" /><input type=\"hidden\" name=\"rurl\" value=\"" + Base.BasePage.Config.WebURL + "Supply/Index" + Base.BasePage.Config.Rewrite + "\" /></p></form>";
                    returnMsg += "</div>";
                    returnMsg += "<p class=\"ohlne mar_top\"></p>";
                    returnMsg += "<ul class=\"chuod cp3\">";
                }
                else
                {
                    returnMsg += "<li><form id=\"MarketSales" + scount + "\" method=\"post\" action=\"{PB_weburl}Member/MarketSales/RcountAdd.aspx\"><input id=\"submit\" type=\"submit\" value=\"报名\"  /><input type=\"hidden\" name=\"mid\" value=\"" + dr["ID"] + "\" /><input type=\"hidden\" name=\"rurl\" value=\"" + Base.BasePage.Config.WebURL + "Supply/Index" + Base.BasePage.Config.Rewrite + "\" /> <a title=\"\" target=\"_blank\" href=\"" + Base.BasePage.Config.WebURL + "MarketSales/Detail.aspx?id=" + dr["ID"] + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["Title"].ToString()), 15) + "</a></form></li>";
                }
                if (scount == dt.Rows.Count)
                {
                    returnMsg += "</ul>";
                }
                scount++;
            }
            return returnMsg;
        }

        private DataTable GetcompanyCount(string strWhere)
        {
            string str = " select * from U_UserInfo";
            if (strWhere != "")
            {
                str += " where " + strWhere;
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }
        private DataTable Getcompanyfiles(int userid)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery(" select a.LoginName,a.Logo, a.CompanyName ,a.BusinessModel,b.[Name] as vipName,c.SupplyCount,count(d.ID) as cercount ,(datediff(year,RegDate,getdate())) as regtime from dbo.U_UserInfo as a left join dbo.U_VipGrade as b on a.GradeID=b.ID left join dbo.U_UserOperate as c on a.UserID=c.UserID left join dbo.C_Certificate as d on a.UserID=d.UserID where a.UserID=" + userid + " group by a.LoginName,a.CompanyName ,a.BusinessModel,b.[Name],c.SupplyCount,a.RegDate,a.Logo ");
            return dt;
        }
        private DataTable GetZsjmList(string strWhere)
        {
            string str = "SELECT a.*,b.CompanyName,b.Province,b.City FROM [W_SincereAgent] as a left join U_UserInfo as b on a.UserID=b.UserID ";
            if (strWhere != "")
            {
                str += " where " + strWhere;
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }
        public DataTable GetNewExpo(int num)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery(" select top " + num + " a.ID,a.Title,a.AddDate,b.[Type],b.ID as typeid from W_Expo as a left join dbo.W_ExpoType as b on a.TypeID=b.ID order by AddDate desc");
            return dt;
        }
        private DataTable GetcompSincere(int sintype)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery(" select distinct top 6 a.UserID,a.CompanyName,a.LoginName,count(b.ID) as acount from dbo.U_UserInfo as a , dbo.W_SincereAgent as b where a.UserID=b.UserID and b.SinType="+sintype+" group by a.UserID,a.CompanyName,a.LoginName order by count(b.ID) desc  ");
            return dt;
        }
        private DataTable GetSquareList(int num)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery("select top " + num + " a.*,b.Detail as anDetail from dbo.W_KnowProblems as a left join dbo.W_KnowAnswer as b on a.ID=b.ProblemsID where a.AnswerCount <>0 order by a.AddDate desc,b.AddDate desc");
            return dt;
        }
        private DataTable GetMerchants(int num,string strWhere)
        {
            string str = "SELECT top " + num + " a.*,b.Name as tName FROM [W_SincereAgent] as a left join W_AgentType as b on a.AgentType=b.ID ";
            if (strWhere != "")
            {
                str += " where " + strWhere;
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }
        /// <summary>
        /// 重点推荐
        /// </summary>
        /// <returns></returns>
        private string SupplierPut(int top)
        {
            string strWhere = " a.Recommend=1 and a.Verify=1";

            StringBuilder strBuilder = new StringBuilder();
            try
            {
                //DataTable Lists = Pagination.GetDataTable(strWhere, " C_Supply as a left join U_UserInfo as b on a.UserID=b.UserID");
                DataTable Lists = GetPutSupply(4);
                int row = 0;
                foreach (DataRow dr in Lists.Rows)
                {
                    string newspname = dr["Name"].ToString();
                    if (newspname.Length > 13)
                    {
                        newspname = newspname.Substring(0, 13);
                    }
                    string itype = GetIndustryType(dr["IndType"].ToString());
                    if (itype.ToString().Length > 5)
                    {
                        itype = itype.Substring(0, 5);
                    }
                    row++;
                    if (row == 1)
                    {
                        strBuilder.Append("<div class=\"czhnr\">");
                        strBuilder.Append("<a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebUrl}Supply/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + dr["Thumbnail"] + "\" /></a>");
                        strBuilder.Append("<b><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebUrl}Supply/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + newspname + "</a></b>");
                        strBuilder.Append("<p><a title=\"" + dr["LoginName"] + "\" target=\"_blank\" class=\"l_c00\" href=\"" + Base.BasePage.Config.WebURL + "shops/index/" + dr["LoginName"] + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["LoginName"].ToString()), 12) + "</a> [" + dr["vipName"] + "]</p>");
                      //  strBuilder.Append("<a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"{PB_webUrl}Supply/Trade-" + (dr["IndType"].ToString() + ",").Split(',')[0] + Base.BasePage.Config.Rewrite + "\">[" + itype + "]</a>");
                        strBuilder.Append("</div>");
                        strBuilder.Append("<ul class=\"chuod cp\">");
                    }
                    else
                    {
                        strBuilder.Append("<li><a title=\"" + dr["Name"] + "\" target=\"_blank\" class=\"l_c00\" href=\"{PB_webUrl}Supply/Trade-" + dr["IndType"].ToString().Trim(',').Split(',')[dr["IndType"].ToString().Trim(',').Split(',').Length - 1] + Base.BasePage.Config.Rewrite + "\">[" + itype + "]</a><a title=\"\" target=\"_blank\" href=\"{PB_WebUrl}Supply/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + newspname + "</a></li>");
                    }
                    if (row > 4)
                    {
                        break;
                    }
                }
                if (strBuilder.ToString() != "")
                {
                    strBuilder.Append("</ul>");
                }
                return strBuilder.ToString();
            }
            catch (Exception e)
            {
                return e.Message;
            }
        }
        /// <summary>
        /// 求购重点推荐
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        private string PurchasePut(int top)
        {
            string strWhere = " a.Recommend=1 and a.Verify=1";

            StringBuilder strBuilder = new StringBuilder();
            try
            {
                DataTable Lists = GetPutPurchase(4);
                int row = 0;
                foreach (DataRow dr in Lists.Rows)
                {
                    string newspname = dr["Name"].ToString();
                    if (newspname.Length > 13)
                    {
                        newspname = newspname.Substring(0, 13);
                    }
                    string itype = GetIndustryType(dr["IndType"].ToString());
                    if (itype.ToString().Length > 5)
                    {
                        itype = itype.Substring(0, 5);
                    }
                    row++;
                    if (row == 1)
                    {
                        strBuilder.Append("<div class=\"czhnr\">");
                        strBuilder.Append("<a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebUrl}Purchase/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + dr["Thumbnail"] + "\" /></a>");
                        strBuilder.Append("<b><a title=\"" + dr["Name"] + "\" target=\"_blank\" href=\"{PB_WebUrl}Purchase/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + newspname + "</a></b>");
                        strBuilder.Append("<p><a title=\"" + dr["LoginName"] + "\" target=\"_blank\" class=\"l_c00\" href=\"" + Base.BasePage.Config.WebURL + "shops/index/" + dr["LoginName"] + Base.BasePage.Config.Rewrite + "\">" + Function.GetString(Base.Common.RemoveHTML(dr["LoginName"].ToString()), 12) + "</a> [" + dr["vipName"] + "]</p>");
                        //  strBuilder.Append("<a title=\"\" target=\"_blank\" class=\"l_c00\" href=\"{PB_webUrl}Supply/Trade-" + (dr["IndType"].ToString() + ",").Split(',')[0] + Base.BasePage.Config.Rewrite + "\">[" + itype + "]</a>");
                        strBuilder.Append("</div>");
                        strBuilder.Append("<ul class=\"chuod cp\">");
                    }
                    else
                    {
                        strBuilder.Append("<li><a title=\"" + dr["Name"] + "\" target=\"_blank\" class=\"l_c00\" href=\"{PB_webUrl}Purchase/Trade-" + dr["IndType"].ToString().Trim(',').Split(',')[dr["IndType"].ToString().Trim(',').Split(',').Length - 1] + Base.BasePage.Config.Rewrite + "\">[" + itype + "]</a><a title=\"\" target=\"_blank\" href=\"{PB_WebUrl}Purchase/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + newspname + "</a></li>");
                    }
                    if (row > 4)
                    {
                        break;
                    }
                }
                if (strBuilder.ToString() != "")
                {
                    strBuilder.Append("</ul>");
                }
                return strBuilder.ToString();
            }
            catch (Exception e)
            {
                return e.Message;
            }
            
        }

        private string GetIndustryType(string ids)
        {
           
            string retVal = "";
            ids = ids.Trim(',');
            string str = "select  [Type] from  W_IndustryType where ID = '" + ids.Split(',')[ids.Split(',').Length - 1] + "'";
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            //string retVal = "";
            //SqlParameter[] param = new SqlParameter[] 
            //{
            //    new SqlParameter("@ids", ids)
            //};
            //DataTable dt = SqlHelper.ExecuteTable(CommandType.StoredProcedure, "SP_W_selectIndustryType", param);
            if (dt.Rows.Count != 0)
            {
                retVal = dt.Rows[0]["Type"].ToString();
            }
            return retVal;
        }
        private DataTable GetPutSupply(int num)
        {
            string str = "select ";
            if (num > 0)
            {
                str += " top " + num;
            }
            str += " a.*,b.*,c.Name as vipName from  C_Supply as a left join U_UserInfo as b on a.UserID=b.UserID left join dbo.U_VipGrade as c on b.GradeID=c.ID  where a.Recommend=1 and a.Verify=1 and (datediff(hh,a.EndDate,getdate())<0) ";
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }
        private DataTable GetPutPurchase(int num)
        {
            string str = "select ";
            if (num > 0)
            {
                str += " top " + num;
            }
            str += " a.*,b.*,c.Name as vipName from  C_Purchase as a left join U_UserInfo as b on a.UserID=b.UserID left join dbo.U_VipGrade as c on b.GradeID=c.ID  where a.Recommend=1 and a.Verify=1 and (datediff(hh,a.EndDate,getdate())<0) ";
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }

        private DataTable GetHotSupplyInType(int num)
        {
            string str = "select ";
            if (num > 0)
            {
                str += " top " + num;
            }
            str += " a.ID, a.Type, count(b.id) from  dbo.W_IndustryType as a, dbo.C_Supply as b  where patindex('%,'+rtrim( a.ID)+',%',','+ b.IndType+',')>0 and b.Verify=1 group by a.Type,a.ID order by count(b.id) desc  ";
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }

        private DataTable GetHotJobType(int num)
        {
            string str = "select ";
            if (num > 0)
            {
                str += " top " + num;
            }

            str += " a.ID, a.TypeName, count(b.id) as jcount from  dbo.C_JobType as a, dbo.C_Job as b  where a.ID=b.TypeID  group by a.TypeName,a.ID order by count(b.id) desc  ";
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }
        private DataTable GetHotPurchaseInType(int num)
        {
            string str = "select ";
            if (num > 0)
            {
                str += " top " + num;
            }
            str += " a.ID, a.Type, count(b.id) from  dbo.W_IndustryType as a, dbo.C_Purchase as b  where patindex('%,'+rtrim( a.ID)+',%',','+ b.IndType+',')>0 and b.Verify=1 group by a.Type,a.ID order by count(b.id) desc  ";
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }

        
        /// <summary>
        /// 根据表名，条件 ，条数 查询详细信息
        /// </summary>
        /// <param name="tabName"></param>
        /// <param name="strWhere"></param>
        /// <param name="num"></param>
        /// <returns></returns>
        private DataTable GetMessage(string selStr, string tabName, string strWhere, int num)
        {
            string str = "select ";
            if (num > 0)
            {
                str += " top " + num+" ";
            }
            str += " " + selStr + " from " + tabName + " ";
            if (strWhere != "")
            {
                str += " where " + strWhere;
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }
        /// <summary>
        /// 取得相关展会
        /// </summary>
        /// <param name="Model"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private DataTable GetRelateExpo(int id)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery("select top 10 * from W_Expo where userid=(select userid from w_expo as b where b.id=" + id + ")");
            return dt;
        }
        /// <summary>
        /// 取得相关市场展销
        /// </summary>
        /// <param name="Model"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private string GetRelateMarketSales(int id)
        {
            string returnStr = "";
            DataTable dt = SqlHelper.ExecuteSqlQuery("select top 10 * from C_MarketSales where userid=(select userid from C_MarketSales as b where b.id=" + id + ")");
            foreach (DataRow dr in dt.Rows)
            {
                string newexpoTitle = dr["Title"].ToString();
                if (newexpoTitle.ToString().Length > 17)
                {
                    newexpoTitle = newexpoTitle.Substring(0, 17);
                }
                returnStr += "<li>▪&nbsp;<a title=\"\" href=\"{PB_WebURL}MarketSales/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + newexpoTitle + "</a></li>";
            }
            return returnStr;
        }
        /// <summary>
        /// 读取资讯
        /// </summary>
        /// <param name="num"></param>
        /// <param name="TypeID"></param>
        /// <returns></returns>
        private DataTable GetConsultative(int num ,int TypeID)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT top " + num + " * FROM [W_Consultative] where TypeID='" + TypeID + "'");
            return dt;
        }
        private DataTable GetExpoList(string Etype,string strWhere)
        {
            string sqlstr = " select top 7 a.*,b.Type,c.City  from W_Expo as a left join  W_ExpoType as b on a.TypeID=b.ID left join U_UserInfo as c on a.UserID=c.UserID where a.ExpoType='" + Etype + "' and (datediff(hh,a.EndDate,getdate())<0) ";
            if (strWhere != "")
            {
                sqlstr += " and " + strWhere;
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery(sqlstr);
            return dt;
        }
        private DataTable GetExpo(string strWhere,int num)
        {
            string strsql = " select top " + num + " a.*,b.Type from W_Expo as a left join W_ExpoType as b on a.TypeID=b.ID  where Verify=1 and (datediff(hh,a.EndDate,getdate())<0) and Picture<>''  ";
            if (strWhere != "")
            {
                strsql += " And " + strWhere;
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery(strsql);
            return dt;
        }
        private DataTable GetEXproAdImg(int AdTypeID)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT top 3 * FROM [W_Ad_MemberInfo] where T_ID='" + AdTypeID + "'");
            return dt;
        }
        private DataTable GetKnowInfo(int isdone)
        {
            string str = " select top 7 a.ID,a.UserName,a.Caption,a.AddDate,a.AnswerCount,a.State,b.Name from W_KnowProblems as a inner join W_KnowType b on a.TypeID=b.ID where State=" + isdone;
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }
        private DataTable GetJob(int num)
        {
            string str = " select top "+num+" c.LoginName,c.CompanyName,c.Summary,a.TypeID,a.ID,b.TypeName,a.Position,a.Count,a.Degree,a.SalaryLevel,a.Sex,a.AddDate,a.EndDate,a.Experience,a.WorkTemper,a.Address";
            str += " from [C_Job] as a,[C_JobType] as b,[U_UserInfo] as c";
            str += " where  a.TypeID=b.ID AND a.Verify=1 and (datediff(hh,a.EndDate,getdate())<0) AND a.UserID=c.UserID order by a.AddDate desc";
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }

        private DataTable GetResume(int num)
        {
            string str = " select top " + num + " [U_Resume].ID,[C_JobType].TypeName,[C_JobType].ID as TypeID,[U_Resume].WantPosition,[U_Resume].Photo,[U_Resume].Sex,[U_Resume].ContactAddress,[U_Resume].AddDate,[U_Resume].txtwork,[U_Resume].HighestEducation,[U_Resume].GraduateSchool,[U_Resume].WantAddress,[U_Resume].WantSalary,[U_Resume].Name ";
            str += " from U_Resume left join C_JobType on(U_Resume.TalentType=C_JobType.id)";
            str += " where  [U_Resume].Verify=1 order by U_Resume.addDate desc ";
            DataTable dt = SqlHelper.ExecuteSqlQuery(str);
            return dt;
        }

        private string GetSortName(string Sort)
        {
            if (GetRequest.isNum(Sort))
            {
                DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT * FROM [U_VipGrade] WHERE Sort=" + Sort);
                if (dt.Rows.Count > 0)
                {
                    return dt.Rows[0]["Name"].ToString();
                }
            }
            return "{参数错误}";
        }
        //根据分类ID获取行业资讯信息
        private DataTable GetInfoByID(int id)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT top 6 * FROM [W_Consultative] WHERE TypeID=" + id);
            return dt;
        }

        //根据广告位获取广告信息
        private DataTable GetAD(int num, int adtypeID)
        {
            DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT top " + num + " a.*,b.Ad_Width,b.Ad_Height FROM [W_Ad_MemberInfo] as a, [W_Ad_Table] as b WHERE a.T_ID=b.T_ID and a.T_ID=" + adtypeID);
            return dt;
        }
        //获取招商，代理，求购，供应信息
        private DataTable GetZDGQInfo(int num,string tabName,int isTop)
        {
            string sql = "SELECT ";
            if (isTop == 1)
            {
                if (num > 0)
                {
                    sql += " TOP " + num + " ";
                }
                sql += " a.*,b.Province,b.City,b.Area from " + tabName + " as a left join U_UserInfo as b on a.UserID=b.UserID where a.Verify=1 and (datediff(hh,a.EndDate,getdate())<0) order by adddate desc ";
            }
            else
            {
                sql += " TOP (7) a.*, b.Province,b.City,b.Area FROM  " + tabName + " AS a LEFT OUTER JOIN U_UserInfo AS b ON a.UserID = b.UserID WHERE     (a.ID NOT IN (SELECT     TOP (6) ID FROM " + tabName + " AS tab_1 where tab_1.Verify=1 and (datediff(hh,tab_1.EndDate,getdate())<0) order by adddate desc )) and a.Verify=1 and (datediff(hh,a.EndDate,getdate())<0) order by adddate";
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery(sql);
            return dt;
        }

        private DataTable GetEXproInfo(int num)
        {
            int topnum = 1;
            if (num > 0)
            {
                topnum = num;
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT top " + topnum + " * FROM [W_Expo] WHERE  Picture!='' AND Verify=1 order by AddDate desc");
            return dt;
        }

        private DataTable GetEXproList(int num)
        {
            int topnum = 1;
            if (num > 0)
            {
                topnum = num;
            }
            DataTable dt = SqlHelper.ExecuteSqlQuery("SELECT top " + topnum + " * FROM [W_Expo] WHERE Verify=1 order by AddDate desc");
            return dt;
        }

        /// <summary>
        /// 处理私有变量
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        private string PRFunction(string strInfo, string str)
        {
            string Restr = "";
            try
            {
                switch (StrModule.ToUpper())
                {

                    case "NEWS_INDEX":              //资讯首页
                        Restr = clsNewslable.PR_NewsIndex(strInfo, str);
                        break;
                    case "NEWS_TRADE":              //资讯分类页
                        Restr = clsNewslable.PR_NewsTrade(strInfo, str);
                        break;
                    case "NEWS_DETAIL":             //资讯详细页
                        Restr = clsNewslable.PR_NewsDetail(strInfo, str);
                        break;
                    case "NEWS_RESTORE":             //资讯详细页
                        Restr = clsNewslable.PR_NewsRestore(strInfo, str);
                        break;
                    case "PURCHASE_INDEX":          //求购首页
                        Restr = clsProductLable.PR_PurchaseIndex(strInfo, str);
                        break;
                    case "PURCHASE_TRADE":          //求购分类页
                        Restr = clsProductLable.PR_PurchaseTrade(strInfo, str);
                        break;
                    case "PURCHASE_DETAIL":         //求购详细页
                        Restr = clsProductLable.PR_PurchaseDetail(strInfo, str);
                        break;
                    case "SUPPLY_INDEX":            //供应首页
                        Restr = clsProductLable.PR_SupplyIndex(strInfo, str);
                        break;
                    case "SUPPLY_TRADE":            //供应分类页
                        Restr = clsProductLable.PR_SupplyTrade(strInfo, str);
                        break;
                    case "SUPPLY_DETAIL":           //供应详细页
                        Restr = clsProductLable.PR_SupplyDetail(strInfo, str);
                        break;
                    case "CORPORATION_INDEX":       //公司库首页
                        Restr = clsUserlable.PR_CorporationIndex(strInfo, str);
                        break;
                    case "COMPANY_TRADE":           //公司库首页
                        Restr = clsUserlable.PR_CorporationTrade(strInfo, str);
                        break;
                    case "CORPORATION_DETAIL":      //公司库首页
                        Restr = clsUserlable.PR_CorporationDetail(strInfo, str);
                        break;
                    case "EXPO_INDEX":             //展会首页
                        Restr = clsExpoLable.PR_ExpoIndex(strInfo, str);
                        break;
                    case "EXPO_TRADE":             //展会分类页
                        Restr = clsExpoLable.PR_ExpoTrade(strInfo, str);
                        break;
                    case "EXPO_DETAIL":            //展会分类页
                        Restr = clsExpoLable.PR_ExpoDetail(strInfo, str);
                        break;
                    case "AGENT_INDEX":            //招商加盟首页
                        Restr = clsAgentLable.PR_AgentIndex(strInfo, str);
                        break;
                    case "AGENT_TRADE":           //招商分类页
                        Restr = clsAgentLable.PR_AgentWTrade(strInfo, str);
                        break;
                    case "AGENT_DETAIL":          //招商详细页
                        Restr = clsAgentLable.PR_AgentSDetail(strInfo, str);
                        break;
                    case "PRODUCT_TRADE":          //产品库分类页
                        Restr = clsProducts.PR_ProductTrade(strInfo, str);
                        break;
                    case "PRODUCT_DETAIL":          //产品库详细页
                        Restr = clsProducts.PR_ProductDetail(strInfo, str);
                        break;
                    case "SOLELY":          //加盟详细页
                        Restr = systemic.PR_SOLELY(strInfo, str);
                        break;
                    case "HELP_TRADE":          //帮助左侧
                        Restr = HelpLabel.PR_HelpTrade(strInfo, str);
                        break;
                    case "HELP_DETAIL":          //帮助详细
                        Restr = HelpLabel.PR_Detail(strInfo, str);
                        break;
                    case "WEBNEWS_TRADE":        //公告列表
                        Restr = WebNewsLabel.PR_Trade(strInfo, str);
                        break;
                    case "WEBNEWS_DETAIL":        //公告内容
                        Restr = WebNewsLabel.PR_Detail(strInfo, str);
                        break;
                    case "KNOW_INDEX":          //知道首页
                        Restr = clsKnow.PR_KnowTrade(strInfo, str);
                        break;
                    case "KNOW_TRADE":         //知道分类页
                        Restr = clsKnow.PR_KnowTrade(strInfo, str);
                        break;
                    case "KNOW_DETAIL":         //知道详细页
                        Restr = clsKnow.PR_KnowDetail(strInfo, str);
                        break;
                    case "KNOW_MYANSWER":         //知道分类页
                        Restr = clsKnow.PR_KnowTrade(strInfo, str);
                        break;
                    case "JOB_LAVOROINDEX":      //人才首页
                        Restr = Lavoro.PR_LavoroIndex(strInfo, str);
                        break;
                    case "JOB_TRADE":         //招聘分类页
                        Restr = Lavoro.PR_JobTrade(strInfo, str);
                        break;
                    case "JOB_DETAIL":         //招聘详细页
                        Restr = Lavoro.PR_JobDetail(strInfo, str);
                        break;
                    case "JOB_WANTED":         //招聘详细页
                        Restr = Lavoro.PR_JobDetail(strInfo, str);
                        break;
                    case "RESUME_TRADE":         //求职分类页
                        Restr = Lavoro.PR_ResumeTrade(strInfo, str);
                        break;
                    case "RESUME_DETAIL":         //求职详细页
                        Restr = Lavoro.PR_ResumeDetail(strInfo, str);
                        break;
                    case "JOB_CATEGORIES":         //求职详细页
                        Restr = Lavoro.PR_ResumeDetail(strInfo, str);
                        break;
                    default:
                        Restr = strInfo;
                        break;

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Restr;
        }


        /// <summary>
        /// 处理用户标签
        /// </summary>
        /// <param name="str">标签名称</param>
        /// <returns></returns>
        private string WSFunction(string str)
        {
            string Restr = "";
            TUserLable Temp = new RUserLable().GateItem(str);
            if (Temp.Info == null || Temp.Info == "")
                return "{" + str + "}";
            else
                Restr = Temp.Info.ToString();
            return Restr;
        }


        /// <summary>
        /// 处理系统标签
        /// </summary>
        /// <param name="Temp"></param>
        /// <returns></returns>
        private string SYFunction(TSystemLable Temp)
        {
            string Mode = "";
            Mode = this.StrModule;
            string Restr = "";
            switch (Temp.Title.ToString().ToUpper())
            {
                case "DIY_NEWSINFO":            //资讯详细信息
                    Restr = clsNewslable.DIY_NewsInfo(Temp);
                    break;
                case "SY_RELATEDNEWS":          //相关资讯
                    Restr = clsNewslable.SY_RelatedNews(Temp);
                    break;
                case "SY_NEWSLIST_PIC":         //资讯图文列表
                    Restr = clsNewslable.SY_NewsList_Pic(Temp);
                    break;
                case "SY_DIGGLIST":         //资讯图文列表
                    Restr = clsNewslable.SY_DiggList(Temp, Mode);
                    break;
                case "SY_NEWSINFOTYPE":         //资讯类别
                    Restr = clsNewslable.SY_NewsType(Temp);
                    break;
                case "SY_NEWSLIST_STR":         //资讯文字列表
                    Restr = clsNewslable.SY_NewsList_Str(Temp);
                    break;
                case "DIY_NEWSLIST":          //自定义供应信息
                    Restr = clsNewslable.DIY_NewsList(Temp, Mode);
                    break;
                case "DIY_SUPPLYINFO":          //自定义供应信息
                    Restr = clsProductLable.DIY_SupplyInfo(Temp);
                    break;
                case "DIY_PRODUCTINFO":          //自定义求购信息
                    Restr = clsProductLable.DIY_ProductInfo(Temp);
                    break;
                case "SY_WEBLOGO":              //网站LOGO
                    Restr = systemic.SY_WebLogo(Temp);
                    break;
                case "SY_PRODUCTLIST_PIC":      //产品图文列表
                    Restr = clsProductLable.SY_Productlist_Pic(Temp);
                    break;
                case "SY_PRODUCTLIST_STR":      //产品图文列表
                    Restr = clsProductLable.SY_Productlist_Str(Temp);
                    break;
                case "SY_POSTS":                //网站公告
                    Restr = systemic.SY_Posts(Temp);
                    break;
                case "SY_LINKS":                //友情链接
                    Restr = systemic.SY_Links(Temp);
                    break;
                case "DIY_USERINFO":            //会员信息
                    Restr = clsUserlable.DIY_UserInfo(Temp, Mode);
                    break;
                case "DIY_PURCHASELIST":        //求购详细信息列表
                    Restr = clsProductLable.DIY_Purchaselist(Temp, Mode);
                    break;
                case "DIY_PURCHASELIST_SEARCH":        //求购详细信息列表
                    Restr = clsProductLable.DIY_Purchaselist_Search(Temp, Mode);
                    break;
                case "DIY_SUPPLYLIST":          //供应详细信息列表
                    Restr = clsProductLable.DIY_Supplylist(Temp, Mode);
                    break;
                case "DIY_SUPPLYLIST_SEARCH":
                    Restr = clsProductLable.DIY_Supplylist_Search(Temp, Mode);
                    break;
                case "SY_COMPANYLIST_PIC":      //公司详细信息列表
                    Restr = clsUserlable.SY_Companylist_Pic(Temp);
                    break;
                case "SY_INDUSTRY":             //求购详细信息列表
                    Restr = systemic.SY_Industry(Temp);
                    break;
                case "SY_EXPO_PIC":             //展会图文列表
                    Restr = clsExpoLable.SY_Expo_Pic(Temp);
                    break;
                case "SY_EXPO_STR":             //展会图文列表
                    Restr = clsExpoLable.SY_Expo_Str(Temp);
                    break;
                case "DIY_EXPOINFO":             //展会图文列表
                    Restr = clsExpoLable.DIY_ExpoInfo(Temp);
                    break;
                case "SY_EXPONEWS_PIC":         //展会资讯图文列表
                    Restr = clsExpoLable.SY_ExpoNews_Pic(Temp);
                    break;
                case "SY_EXPONEWS_STR":         //展会资讯文字列表
                    Restr = clsExpoLable.SY_ExpoNews_Str(Temp);
                    break;
                case "DIY_EXPOLIST":            //展会图文列表
                    Restr = clsExpoLable.DIY_ExpoList(Temp);
                    break;
                case "DIY_EXPOTRADELIST":       //展会图文列表
                    Restr = clsExpoLable.DIY_ExpoTradelist(Temp, Mode);
                    break;
                case "DETAILNEWPRODUCT":        //供应详细页
                    Restr = clsProductLable.SY_DetailNewProduct(Temp);
                    break;
                case "SY_AGENTLIST_PIC":        //创业加盟图文
                    Restr = clsAgentLable.SY_AgentList_Pic(Temp);
                    break;
                case "SY_AGENTLIST_STR":       //创业加盟文字
                    Restr = clsAgentLable.SY_AgentList_Str(Temp);
                    break;
                case "SY_DETAILNEWPRODUCT":       //创业加盟文字
                    Restr = clsProductLable.SY_DetailNewProduct(Temp);
                    break;
                case "SY_COMPANYLIST_STR":       //创业加盟文字
                    Restr = clsUserlable.SY_CompanyList_Str(Temp);
                    break;
                //case "DIY_SAGENTLIST":       //创业加盟文字
                //    Restr = clsAgentLable.DIY_STradelist(Temp, Mode);
                //    break;
                case "DIY_WAGENTLIST":       //创业加盟文字
                    Restr = clsAgentLable.DIY_Tradelist(Temp, Mode);
                    break;
                //case "DIY_SAGENTINFO":       //创业加盟
                //    Restr = clsAgentLable.DIY_SAgentInfo(Temp);
                //    break;
                case "DIY_SAGENTINFO":       //愿做代理
                    Restr = clsAgentLable.DIY_WAgentInfo(Temp);
                    break;
                case "DIY_COMPANYLIST":
                    Restr = clsUserlable.DIY_Companylist(Temp, Mode);
                    break;
                case "DIY_COMPANYLIST_SEARCH":
                    Restr = clsUserlable.DIY_Companylist_Search(Temp, Mode);
                    break;
                //case "SY_JOBWANTEDLIST":
                //    Restr = Lavoro.DIY_JobWanted_List(Temp, Mode);
                //    break;
                case "DIY_KNOWPROBLEMSLIST":   //知道问题列表
                    Restr = clsKnow.DIY_KnowProblemsList(Temp, Mode);
                    break;
                case "DIY_KNOWPROBLEMSINFO":   //知道问题详细信息
                    Restr = clsKnow.DIY_KnowProblemsInfo(Temp);
                    break;
                case "DIY_KNOWANSWERINFO":     //知道回答信息
                    Restr = clsKnow.DIY_KnowAnswerInfo(Temp);
                    break;
                case "SY_NEWSLIST":     //资讯列表标签
                    Restr = clsNewslable.SY_NewsList(Temp);
                    break;
                case "SY_NEWSDETAIL":    //资讯内容标签
                    Restr = clsNewslable.SY_NewsInfo(Temp);
                    break;
                case "SY_NEWSTYPELIST":   //资讯类别列表标签
                    Restr = clsNewslable.SY_NewsTypeList(Temp);
                    break;
                case "SY_JOBLIST":   //招聘列表标签
                    Restr = Lavoro.SY_JobList(Temp);
                    break;
                case "SY_JOBINFO":   //资讯类别列表标签
                    Restr = Lavoro.SY_JobInfo(Temp);
                    break;
                case "SY_RESUMELIST":   //资讯类别列表标签
                    Restr = Lavoro.SY_ResumeList(Temp);
                    break;
                case "SY_RESUMEINFO":   //资讯类别列表标签
                    Restr = Lavoro.SY_ResumeInfo(Temp);
                    break;
                case "SY_LAVOROTYPELIST":   //资讯类别列表标签
                    Restr = Lavoro.SY_LavoroTypeList(Temp);
                    break;
                case "SY_INDEXINDUSTRY":    //首页类别显示
                    Restr = systemic.SY_INDEXINDUSTRY(Temp);
                    break;
                default:
                    Restr = "不存在此类型标签";
                    break;
            }
            return Restr;
        }


        /// <summary>
        /// 获取方法名称
        /// </summary>
        /// <param name="parame"></param>
        /// <returns></returns>
        private string tempTitle(string parame)
        {
            int nstart = parame.IndexOf("(");
            return parame.Substring(0, nstart);
        }


        /// <summary>
        /// 获取参数列表
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        private string tempInfo(string str)
        {
            int nstart = str.IndexOf("(");
            int nend = str.IndexOf(")");
            return str.Substring(nstart + 1, nend - nstart - 1);
        }


        /// <summary>
        /// 获取标签名称
        /// </summary>
        /// <param name=""></param>
        private string staticTitle(string str)
        {
            int no = str.Length - 2;
            if (str.Contains("("))
                no = str.IndexOf('(') - 1;
            return str.Substring(1, no);
        }


        /// <summary>
        /// 取得系统标签所需信息
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        private TSystemLable Get_Function(string str)
        {
            TSystemLable Temp = new RSystemLable().GateItem(str);
            return Temp;
        }
    }
}